WordPress CMS modifications
Making WordPress the ultimate CMS!

Oct/07

10

Get rid of /category/ in URL with the Top Level Categories plugin

Optimising and changing the URL (address) structure is one of the most important things to do with your website – to make it easier for both humans and search engines to use!

WordPress uses the ‘permalink’ structure to make ‘pretty’ URL’s – so http://www.yoursite.com/?p=123 becomes http://www.yoursite.com/about – this works fine with pages in WordPress, but with the category view of posts you end up with a URL of http://www.yoursite.com/category/plugins – not ideal!

There are ways around this – you could create custom page templates and build custom database queries to list the relevant content, basically replacing the category view page, but this still leaves this nasty URL functioning.

The Top Level Categories plugin from Filipe Fortes fixes this – turning your categories permalink URL from http://www.yoursite.com/category/plugins to http://www.yoursite.com/plugins – nice and easy!

Ideally you should deploy this plugin right from day one of site launch – just so people start using the optimised URL’s straight away.

WordPress installation

  1. Ensure you are using (or can use) Permalinks
  2. Download the latest file
  3. Unzip file
  4. Upload decompressed file named top-level-cats.php to wp-content/plugins/
  5. Login and activate the plugin
  6. Once activated, ensure that you update your Permalink structure in Options > Permalinks

WordPress template tags

No template tags are needed, this changes the Permalink structure behavior.

Plugin code modification

None available at present.

Relevant links and further reading

Top Level Categories plugin page
Plugin author homepage
Wordpress Codex – Permalinks

3 comments

  • junior · February 15, 2008 at 1:35 am

    Thanks for the plug in….my question is… what my Urls have already been indexed by search engine….Do I still need to have this plu in?

    Junior

    Technology Blogger

  • Admin comment by CMS Builder · February 20, 2008 at 8:18 pm

    If your site has already been indexed by search engines, you certainly need to think about how you are going to address this BEFORE you use this plugin on your site! There are a number of solutions, .htaccess redirects are usually the preferred method. You can read lots about them on this page.

    Another solution is to use the Google Sitemaps plugin, which I’m not sure will work with this plugin… I will have to give this a try if I get a breather from work!! This creates an XML sitemap file and submits it to Google, Yahoo and Ask. Also many search engines are looking for ’sitemap.xml’ files on servers now, as it’s much easier to parse one file than follow the links of an ENTIRE site obviously!!

  • Webmasterdays BackOffice » Blog Archive » To install WordPress CMS modifications » Get rid of /category/ in URL with the Top Level Categories plugin · April 27, 2008 at 9:23 am

    [...] WordPress CMS modifications » Get rid of /category/ in URL with the Top Level Categories plugin [...]

Leave a Reply

<<

>>