Are you getting a 404 error on WordPress posts, and already thinking of the reader-base you’ll lose? Take it easy. You’re certainly not the first person it has happened to. And, if we know one thing, it’s that there’s almost nothing a little trial-and-error can’t uncover and eventually turn return to its former glory. With that in mind, this particular error is well-known and often encountered by webmasters. This means there are multiple ways to fix WordPress posts returning 404 error – no advanced knowledge required.
What are the prerequisites?
If you are going to solve the 404 error your WordPress posts are returning, you need to do two things:
- Access your WordPress Admin Section.
- Access your WordPress website’s root folder via FTP. To do this, you have two options:
- Download an FTP client.
In this case, you’ll need to enter a hostname or IP address, username, and password provided by your website’s hosting. They will also specify whether to alter the port and protocol values from the default ones. - Login to your hosting’s cPanel. Find a web app named FTP, Files, or File Manager.
- Download an FTP client.
4 methods to fix 404 error appearing on WordPress posts
1. Reset your permalinks via Dashboard
This solution usually works right off the bat, since broken permalinks are the most common cause.
- Log in to the WordPress Admin Section.
- You should be on the Dashboard page by default.
- Expand the menu on the left, and click on Settings.
- When Settings extends to the right, click on Permalinks.
- Remember the permalinks structure your website is currently using.
This could be Plain, Day and name, Month and name, etc. - Change the structure to any of the other options.
- Click on Save Changes.
- Wait for the page to reload.
- Select the original permalinks structure again.
- Click on Save Changes again.
- Check the posts on your WordPress website, and see if they work properly.
2. Refresh your .htaccess file
These are alternative steps to getting rid of the 404 error on your WordPress posts. Use it when you can’t access the Dashboard, or the steps above didn’t work.
- Log in to your website’s root folder via FTP.
The folder might also be called public_html, www, or has the same name as your domain. - In the base folder, find a file named .htaccess.
- Right-click on it, and look for an option such as Edit, View/Edit, or Open with…
- The file should be downloaded automatically. You can use Notepad or a similar program to edit its contents.
- Delete everything in it, and paste the following code into it which is the default .htaccess code.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress - Save the changes.
- Verify that the changes are applied to the file on the FTP.
- If they aren’t, you can drag-and-drop the new file or find an Upload button then select it.
- Confirm that you want to overwrite the .htaccess file.
- Refresh your website’s posts page.
- If the 404 error is fixed, you can use the Dashboard steps above to change the permalinks structure back to the one you used previously.
What to do if the option to edit doesn’t exist?
- Make a copy of the file on the FTP.
You can also rename the copy to .htaccess-backup or something similar. - Download the file named .htaccess.
- Delete the file on the FTP.
- Do steps #5 and #6 above.
- Upload the new .htaccess file to FTP.
3. Disable WordPress plugins one by one
Giving instructions to restore WordPress posts to normal is hard when we cannot take a look at your website. Instead, you’ll need to do a little troubleshooting yourself. If the error appeared recently, it’s likely the result of a conflict with the latest WordPress plugin you installed.
Option 1.
- Log in to your website’s Admin Dashboard.
- In the menu on the left, choose Plugins.
- Click on All Plugins when the menu expands to the right.
- The plugins that have the Deactivate option are currently active.
- Deactivate the last plugin you installed.
- Check to see if the error is fixed.
- Continue going through the list, and disable them one by one while checking for the error in-between.
- Found the issue? You have three options:
- Update the plugin, and see how it reacts.
- Temporarily disable the plugin, contact the developer, and wait for an update.
- Uninstall the plugin, and seek an alternative.
Option 2.
- Access your website’s FTP.
- Search for a folder titled wp-content inside the public_html (or root, yourwebsitename, www) folder.
- Open the plugins folder.
- To disable a plugin, simply rename its folder name to something random.
For example, akismet.disabled instead of akismet. - If that plugin isn’t the culprit, simply restore its original name, and keep testing by renaming in the same fashion.
- Radical step. You can rename the plugins folder to plugins.disabled.
This will disable all of the plugins, and you’ll at least know if one of them caused the problem. Then you’ll know your troubleshooting time isn’t spent in vain.
4. Reset your WordPress theme to default
If terminating any of the plugins didn’t cause the error to go away, it’s time to suspect your active theme. Luckily, you only have one theme to check, instead of tens of plugins.
Option 1.
- Sign in to your website’s Admin Section.
- In the menu on the left, click on Appearance.
- When it extends, click on Themes.
- Pick a default theme such as Twenty Eighteen or Twenty Nineteen.
- Hover over the theme image, and click on Activate.
- Check if this fixed the error.
- If it did, you again have a choice to update the theme, wait for a future update, or switch to a completely different theme.
Option 2.
- Access your website’s FTP.
- Open the public_html (or root, www, yourwebsitename) folder.
- Open the folder named wp-content.
- Find a folder named themes and open it.
- Rename the folder with the name of your active theme to something like themename.disabled.
- Your WordPress website will use its default theme now.