Hey denfig,
I totally get why this is frustrating—404 errors for pages you don’t even want can feel like a hassle. Let’s figure this out together.
First, WordPress automatically creates category and tag archive pages, even if you’re not actively using them. If you’re not using categories at all, the simplest solution is to disable those pages.
Here’s what you can do:
- Redirect the Page
You can set up a redirect for the unwanted category page to go to your homepage or another relevant page. A plugin like Redirection makes this easy. Once installed, add a redirect rule for the URL that’s giving the 404 error.
- Disable Category Archives
Another option is to prevent WordPress from generating those category pages entirely. You can add a bit of custom code to your theme. Go to Appearance > Theme File Editor, open functions.php
, and add this:
add_action('template_redirect', function(){
if (is_category())
{wp_redirect(home_url());
exit; ? ?
}
});
This will redirect all category archive pages to your homepage.
- Check Your Permalinks
Sometimes, permalink settings can cause these errors. Go to Settings > Permalinks and hit “Save Changes” without making any changes. This forces WordPress to refresh your permalink structure, which might solve the issue.
- Double-Check for Plugins
Some plugins (like SEO or content management tools) may create or link to category pages. If you’re using a plugin like Yoast SEO, check its settings to disable category archives.
Let me know if any of this works for you! If you’re still having trouble or want to double-check before adding code, feel free to share more details about the page URL and your setup.
Cheers,
Jayson