Click here to get The Blog Profits Blueprint

How to add trailing slash to a category/tag/archive

Wordpress November 17th, 2008

    Visited 29602 times, 4 so far today

I had a few people asking me how to add trailing slash (/) to a category. For example http://bloggerholic.com/category/ if you dont have trailing slashes it can cause duplicate content in search engines. Usually the problem occurs if you switch from an older version of wordpress to newer one that doesn’t have trailing slashes. However if you start a new site with the newer version it will be okay. From Worpress versions 2.2 onwards wordpress have removed the trailing slash that was added to the permalinks by default in older versions.

I found the solution to fix this and it’s easy! This is only for WordPress 2.6+
All you need to do is the following:

  1. Go to your wp-includes folder.
  2. find the template file called “link-template.php” and open the file in any text editor.
  3. In this file find the following function:
    function user_trailingslashit($string, $type_of_url = ”) {
  4. Find the following line inside this function:
    if ( $wp_rewrite->use_trailing_slashes )
  5. replace it with the following:
    if ( $type_of_url !== ‘single’ )
  6. Save the file and upload “link-template.php” in wp_includes folder.
    That’s it your done! :)

This book “WordPress for Dummies” provides you with everything you need to get up and running with WordPress. The book covers blogging basics, choosing a hosting solution or setting up a host, developing blog content, syndicating blog posts with RSS, launching a specialized blog (including podcasting, photoblogging, mobile blogging, and videoblogging), and even earning revenue.
It Includes help on every aspect of installing and using WordPress, illustrations from real-world WordPress blogs, step-by-step tutorials on key topics, and insights from bloggers who have used WordPress

             



Resources

Categories

FREE Newsletter

Sign up TODAY and get FREE Tips every Week on Making Money on the Internet 

Recommended Book


      

Tag Cloud

Wordpress Blog Marketing Blogging Tips Blogging Tools and Services Advertising VoIP Blogging for Money Search Engine Optimization Adsense General

Recommended Money Makers


      Text Link Ads
      Blog Mastermind Affiliates
      AuctionAds
      Amazon Associates

Related Articles

Post-Plugin Library missing

Recent Articles