Skip to content

How To Redirect Dead-End Category, Search And Tag URLs In WordPress

Since WordPress 2.5, WordPress automatically handles many redirections on your blog. If you’re using a pretty permalinks in your blog, WordPress will redirect the following three URLs results in 404 (Page Not Found) errors:

  • http://www.example.com/tag/
  • http://www.example.com/category/
  • http://www.example.com/search/

These three pages doesn’t exist by default. However, a visitor of your website and search engines, such as Google, may attempt to load these pages. It will lead them to the 404 error page, which will harm your website’s search engine position.

It will better to redirect dead-end category, search and tag URLs in your WordPress to your homepage to extract any leftover search engine rank juice.

Thanks to DigWP.com, we can accomplish this job by adding following code to .htaccess file:

RedirectMatch 301 ^/tag/$      http://your-domain.com/
RedirectMatch 301 ^/search/$   http://your-domain.com/
RedirectMatch 301 ^/category/$ http://your-domain.com/

Don’t forget to enter your website URL in above code. Plus, if your WordPress install is located in a sub-directory called “blog”, use this code instead:

RedirectMatch 301 ^/blog/tag/$      http://your-domain.com/
RedirectMatch 301 ^/blog/search/$   http://your-domain.com/
RedirectMatch 301 ^/blog/category/$ http://your-domain.com/

Leave a Reply

Your email address will not be published. Required fields are marked *