|
|
SEO Tips Using PHP
2008-04-06
In web development, often some of the small things tend to get overlooked in SEO. One easy way to fix this in websites run by content management systems (CMS) written in PHP is to use the data it provides to further enhances your SEO. In this brief tutorial we'll explore a few key methods that can help you increase your rankings effectively.
Obviously most CMS systems, or even custom sites written in PHP will usually use it to dynamically create the site's title tag. However, don't forget about the meta tags for descriptions and keywords. If you're not using the information in your database to create accurate meta tags, you're wasting some of the available SEO that you could be taking advantage of. For example, changing code like this: <title><?PHP echo $article->article_title();?></title> to something like this: <title><?PHP echo $article->article_title();?></title> <meta name=”Keywords” content=”<?PHP echo $article->article_tags(',');?>”> <meta name=”Description” content=”<?PHP echo $article->article_desc(255);?>”> To continue in this line of thinking, you could add this alt tag to images in your document: <img src=”border-canada.png” /> to this, which will give the image alt tags based off it's tags: <img src=”border-canada.png” alt=”<?PHP echo $article->article_tags(',');?>” /> Here's something aimed at a more advanced web development coder. This applies to site's that have a members system. Essentially the principal is to hide the irrelevant guest information (such as login forms, forgot password pages, as well as header or sidebar content that only applies to humans.) Now you don't want to selectively give the bots one thing and a human another to an extreme, as you can be penalized for this, so this technique should only be used in good taste and to benefit the end user. Information such as a user's post count or join date are not relevant to your potential visitor's search, so why include it?
The technique to hide this information will vary from CMS to CMS, but the principal is the same. Detect whether a bot is viewing the page, and if so, conditionally exclude content that you do not want to load.
So there's a few ways you can use PHP to your advantage to gain extra search engine optimization on your web development projects.
View other articles in the Web Development category.
View other articles in the PHP sub-category. |