Giving specific category posts its own permalink structure returns 404

First off, the add_rewrite_rule() syntax is add_rewrite_rule( ‘RegEx pattern’, ‘WordPress query string/vars’, ‘position/priority – top or bottom’ ). Now I could see you’re trying to have the following permalink structure: Structure: example.com/foodguide/<post ID>/<post slug> Example: example.com/foodguide/1/sample-food-guide But your rewrite rule (the second one in your code) does not have the proper RegEx subpattern for the … Read more

I have a 404 error on all my pages! What do I do?

Try to reset your permalink structure. In your WordPress Dashboard go to Settings > Permalinks. All custom post types require additional slugs like /portfolio-item/, /destination-item/, /tour-item/, /property-item/, /listing/ etc. So you probably made a typo in your custom structure. Select an alternative permalinks structure -> Save Changes. Change it back to your standard structure and … Read more

404 not working, going to homepage; how to fix?

In my case, the issue was the multi-site config attribute NOBLOGREDIRECT This had been set in wp-config.php… // Redirect non-existent Multisite subdomain calls to www primary site define( ‘NOBLOGREDIRECT’, ‘http://www.example.com’ ); This prevents a valid 404 appearing since it is always interpreted as a bad call to a subdomain. There are two solutions: Comment it … Read more

WordPress Admin page Error 404

This issue can be caused by some conflict in theme or plugin. Try renaming plugins folder. Some plugin might be causing this issue. If it works, try to find out by renaming each plugin at a time. Deactivate the plugin which is causing issues. Do the same with themes if renaming plugins do not work.