How to Fix WordPress Custom Post Type 404 Error?

How to Fix WordPress Custom Post Type 404 Error

Presenting our step-by-step guide for beginners that helps you how to fix WordPress custom post type 404 error easily. Stick here till the end!

WordPress is the most used CMS nowadays because of its ease of use. But sometimes a slight tweak could ruin your website or make it inaccessible for your site visitors because of 404 errors.

If it is also happening with you, we’ve got you covered as we’ve mentioned 5 ways to fix WordPress custom post type 404 error. Let’s get started by understanding about custom post types in a brief.

buddyx theme

What do you mean by Custom Post Types?

WordPress is not just a blogging platform with posts and pages as the main content types. Rather, it’s your choice what type of content you would like to present in front of your audience. And, the type of content you’ll use other than the main content type (i.e., Posts and Pages) are known as custom post types. Because you’re customizing your preferences.

For example-

If you want to run a product review website, then you would probably like to create Review Posts on your site. In that case, your Review Post Type can have different custom fields as well as custom categories that you think fit your posts. Similarly, you can create a testimonial content type, Portfolio, Product Post type, Courses, etc.

By default, WordPress comes with five post types Posts, Pages, Attachments, Revisions, Nav Menu, Custom CSS, Changesets, User Data Request

Also Read: Troubleshooting a Critical Error on Your WordPress Website: A Comprehensive Guide

How to create a custom post type?

For all noncoders, just to eliminate the lengthy and complex process of coding, there is no better option than using WordPress Plugins. And, your solution to creating custom post types lies in WordPress Plugins.

One such plugin is Custom Post Type UI which provides you with an easy-to-use interface to register and manage custom post types and taxonomies for your WordPress website.

Custom Post type

Download Plugin

How to fix WordPress Custom Post Type 404 error

Confronting issues with the custom post type error in your site on WordPress?

I can relate to your situation and how it hurts when the server shows the message ‘Error! 404 not found’. Ah! Quite Frustrating! Whenever there is a problem, a solution is also there. Here we are going to tell you 5 ways to fix WordPress custom post type 404 errors easily on your site.

Also Read: Learn To Fix Common WordPress Errors

1. Permalink Settings

A permalink refers to the permanent URL that shows the URL address to your posts, categories, archives, and other pages on your WordPress site. Each post, page, category, and archive has a unique link.

  • Login to your admin dashboard and click on Settings Tab> Permalinks.
    Select the Plain radio option and save the changes.
  • Go to your custom post pages now. Check whether they return 404 error pages or not.
  • If yes, then go back to the Permalinks option under the settings tab and set the permalinks back to default.

permalink settings

If this process is not working, check whether your .htaccess file is updated or not.

2. Check Title and Slug

Maybe your Title and Slug are conflicting because of the similar names.

It might be possible that your custom post-type page has the same title or slug as your actual post type. For example, you have a custom post type ‘product’. On the other hand, you have also created a main page named ‘Product”. This will create a conflict between both with the title/slug ‘product’ resulting in 404 errors on your single post type posts.

Just change the Title/Slug on either of your pages or custom post type to fix 404 errors.

Also Read: Top 15+ A/B Testing Tools To Increase Website Conversions By Fifteen Percent Or More

3. Switch to the default WordPress Theme

Try switching to some default WordPress theme from your custom WordPress theme. Some common examples of default WordPress themes are Twenty Fifteen, Twenty Sixteen or Twenty Seventeen

Now, try to save again and test all permalink structures. Hope this will fix your issues.

4. Update Your WordPress Plugins

You can move on with this option if none of the above-listed ways are working for you.

  • First of all, deactivate all the plugins. Now, try to save permalinks again.
  • After that, activate again your plugins one by one. but don’t forget to resave the permalinks after each plugin activation.
  • Test again all your custom post types.

Also Read: 5 Best WordPress 404 Plugins

5. AutoFlush Rewrite Rules

If you are a developer, you can opt for this method.

Whenever a new custom post type is created and registered, you should not forget to “flush” your rewrite rules in the WordPress site.

How to flush rewrite rules?

  • Click on Settings tab > Permalinks
  • Click the save option.

You can consider autoflush rewrite rules, in case, you’re working on a custom theme or plugin. Here is an example of the code that you can use to rewrite rules:


// Code for themes
add_action( 'after_switch_theme', 'flush_rewrite_rules' );

// Code for plugins
register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );
register_activation_hook( __FILE__, 'myplugin_flush_rewrites' );
function myplugin_flush_rewrites() {
// call your CPT registration function here (it should also be hooked into 'init')
myplugin_custom_post_types_registration();
flush_rewrite_rules();
}

Hope this trick will fix 404 errors in your WordPress site.

Reign WordPress Theme

Final Thoughts on Custom Post Type 404 Error

Fixing 404 errors is important to stick site visitors to your site as well as to improve search engine ranking. If you are still not able to fix your WooCommerce product 404 error, do contact us. We’ll try fixing your problem. Have another issue? Leave a comment below. We’ll find a solution for you.


Interesting Read:

Unraveling the Cost of Building a WordPress Website in the UK

Unleashing the Power of Microsites using WordPress: A Comprehensive Guide to Building and Optimizing with WordPress

Tips For Making A Case Study Presentation

Facebook
Twitter
LinkedIn
Pinterest

Newsletter

Get tips, product updates, and discounts straight to your inbox.

Hidden

Name
Privacy(Required)
This field is for validation purposes and should be left unchanged.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.