How to fix Page not Found Error 404 after Pushing

You may have encountered the “Page not found” error 404 when trying to access a page on your website. This error can occur for various reasons, including a change of permalinks or a broken link. In this article, we’ll show you how to fix the 404 error on WordPress.

One of the most common reasons for the 404 error is a change in your permalinks. Permalinks are the URLs that WordPress generates for your pages and posts. If you’ve recently changed your permalink structure or the URL of a particular page or post, the old URL may no longer work.

  • Go to your WordPress dashboard and navigate to Settings > Permalinks to fix this.
  • Select the permalink structure you want to use and save your changes.

This will regenerate the permalinks for all of your pages and posts.

If you get the error “Page not Found” or the HTTP error code 404 after pushing the staging site to live with WP Staging Pro, you can use the same steps to fix the page not found error 404.

How to fix page not found error 404 in WordPress

By saving the permalinks again, WordPress will recreate and refresh all permalinks. This will often fix the page not found error 404 on your site.

What is the reason for this issue, and why are not all posts/pages affected?

Some plugins create their own type of permalink links in the WordPress database. So, when you push the staging site to live, you will need to tell WordPress to recreate these links; otherwise, they would link to a staging site path, which obviously does not exist on the production site. As a result, an error 404 is shown.

So, if you encounter certain links not working on the production site, just save the permalinks again.

Check Your .htaccess File

If you’re still experiencing the 404 error after checking your permalinks, the issue may be with your .htaccess file. This file is used to configure your website’s server settings and can sometimes become corrupted or misconfigured. To fix this, you can try renaming your .htaccess file to something else (e.g., .htaccess_old) and creating a new .htaccess file. You can do this by going to your WordPress dashboard and navigating to Settings > Permalinks. Click the “Save Changes” button to generate a new .htaccess file.

Check for Broken Links

Another possible reason for the 404 error is a broken link. This can occur if you’ve linked to a page or post that no longer exists or if the URL of the page or post has changed. To fix this, you can use a plugin such as Broken Link Checker to scan your website for broken links. Once you’ve identified the broken links, you can either remove them or update them with the correct URL.

Restore Deleted Pages or Posts

If you’ve recently deleted a page or post, visitors may see the 404 error when trying to access that page or post. You can restore the deleted page or post from your WordPress trash to fix this. Go to your WordPress dashboard and navigate to Posts or Pages > All Posts or All Pages. Click the “Trash” link to view your deleted pages or posts. Select the page or post you want to restore and click the “Restore” button.

In conclusion, the “Page not found” error 404 can frustrate visitors to your WordPress website. By following the tips in this article, you can quickly diagnose and fix the issue. Check your permalinks, .htaccess file, and for broken links, and restore any deleted pages or posts to get your website back up and running smoothly.

Related Articles

Updated on August 3, 2023