• Hi. I am not using categories on my website. However, I continue to get a 404 error for the page linked below. I do not want my site to generate this automatically. How can I prevent this? I am using WordPress.

    • This topic was modified 1 month, 3 weeks ago by denfig.
    • This topic was modified 1 month, 3 weeks ago by Steven Stern (sterndata). Reason: removed redundant URL

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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:

    1. 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.
    2. 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.
    3. 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.
    4. 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

    Thread Starter denfig

    (@denfig)

    Thank you, I will try to stop WordPress from even creating the pages. For now would it make more sense to redirect to a custom 404 page or to my homepage = https://localpresenceseo.com ? I don’t know if going to a 404 page hurts SEO.

    Thread Starter denfig

    (@denfig)

    That was actually /uncategorized/. Will that make a difference?

    Thread Starter denfig

    (@denfig)

    After adding

    add_action('template_redirect', function(){
    if (is_category())
    {wp_redirect(home_url());
    exit; ? ?
    }
    });

    I am still getting a 3XX error.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.