Stop WordPress Redirection From /keyword to /some-post-containing-keyword/

I have tried everything I’ve found.

I can’t stop webhostingbreak.com/ipage/ from redirecting to
webhostingbreak.com/hosting-directory/ipage-hosting/

I tried remove_filter(‘template_redirect’, ‘redirect_canonical’); in my theme’s functions.php.

I tried removing or commenting out add_action(‘template_redirect’, ‘redirect_canonical’); in /wp-includes/canonical.php

I even removed EVERY line of code in canonical.php and still no result… It still redirects like I’ve done nothing.

I changed webhostingbreak.com/hosting-directory/ipage-hosting/ to webhostingbreak.com/hosting-directory/test/ and then I cleared the database of any attachements/old slugs that might cause redirect. It STILL redirects.

I’m out of ideas. I’ve spend 20 hours trying to find answers on this.

1 Answer
1

If that is just one exception you could add an .htaccess rule for it or just use the Redirection plugin. It’s not the best solution but neither is spending 20 hours on it.

Btw, Yoast WordPress SEO has the ability to remove the category base, you don’t need the second plugin anyway.

Leave a Comment