PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

WordPress categories, optimization tips and custom pages

Note: This article was originally published at Planet PHP on 25 October 2010.
Planet PHP

It's not a SEO secret, inner links to / from strong category pages will help your site to rank higher in Google. Sad enough that WordPress doesn't provide a lot of functionality for these important sections on your blog site. This is the information you can read below the field aodescriptiona if you edit a category:

The description is not prominent by default, however some themes may show it.

There is no field for a second title and the description field doesn't allow most of the html elements. I'm using the All in One SEO plugin because it gives me the freedom to write a custom page title or meta description (for posts or pages only). Most SEO plugins doesn't care a lot about category pagesa

First preparations

In my experience it's the best to not index any archive page created by WordPress because they show content duplicates. The category URL could need an update first: By default you get this kind of category URL:

http://www.domain.com/archives/category/some-category-name

We need to remove the aoarchivesa part from the URL, goto Settings-Permalinks and add some unique name for the field aoCategory basea.

If you use the aoAll in One SEOa like I do, disable the following settings:
Canonical URLs, Use noindex for Categories

Head to the plugin category, open the file (aioseop.class.php) and disable (//) row 283 to disable the creation of a meta description for all category pages:

//$description = $this-internationalize(category_description());

This function is buggy because the auto generate option will use the complete category text for a meta description.

We will create for the category pages our own META information and the canonical URLs for posts and pages are created by WordPress since version 2.9. Next you need to create some unique text for all the categories, 100 words is a great text length.

Optimizations for the aogenerateda category pages

We need to create some code to get the right META data in our header section. In the theme directory is a file called aofunctions.phpa, open the file in a text editor and add this code:

function create_short_version($text, $len = 150) { $parts = explode(' ', $text); $ic = count($parts); $txt = ''; for ($i = 0; $i $ic; $i++) { $txt .= $parts[$i].' '; if (strlen($txt) = "/

Truncated by Planet PHP, read more at the original (another 14267 bytes)