Sooner or later error 404 crops up on almost every website. That is no disaster, but if it happens too often, it will harm the overall impression your visitors will get. How can you avoid these errors?
What does error 404 mean?
If you update your blog regularly, revise posts or adjust structures, that may change the URL and the old ones come to nothing.
Every page is indexed with a specific URL by the search engines.
E. g. when your original URL is www.myblog/news/SEO/
and this one changes to www.myblog/news/SE/
Every visitor entering the original URL will receive an error 404 message. Sometimes the browser just displays Page not found. Or the side owner has installed a special page which points out a 404 error in a friendly or funny way.
How to find your dead links?
At first you could use the Google Search Console. You sign in with your Google account.
After you connected your website to it, you will see the count of invalid URLs on the dashboard.
Then you go to
›› Crawling Errors
where all URL segments are listed. Clicking a segment will open an overlay displaying the complete URL and links directing to this URL. Another way to find errors is offered by the Yoast SEO plug-in (see below).
The origin of these errors?
In principle there are several reasons that may lead to an error 404. What does Google say?
Besides those errors there are two more sources:
You revise an older post and change the URL (because it does not fit to the new content or by mistake)
or you delete a post.
When an error 404 crops up there are several ways to deal with it:
1 Ignore it
Depending on the cause of the error ignoring is not the worst option. Such as the respective post does not (longer) exist and you do not have any related post which you could redirect the URL to. Then you should not do anything but wait and see. The mills of Google grind slowly, but one day the posts will disappear from the index and the problem will be solved.
2 Set up a special Error-404-Page
It always makes sense. On the one hand this page is included in many themes resp. SEO-plug-ins. Besides a more or less inventive notification your visitor will usually be provided a search bar and/or a link to your home- / landing page.
On the other hand you may set up your own page by using a specific plug-in or coding. There are a lot of templates to get some inspiration from.
By whatever means, it is important that your visitors will be (re)directed to your website and will not leave forever.
This is the best option for active posts. Your visitor will not observe any error because he will see the new post and not page-not-fount after he entered/clicked a false URL.
Tools by Yoast SEO
This plug-in is already installed on many websites. So it will be an affordable solution, at least, if you do not have hundreds of errors:
At first you log into your backend and open
› Y SEO
Then you go to the .htaccess file and scroll to the end of the list. Down there you configure the redirection for each dead link. You do not have to enter the entire URL, just the affected segment.
Keep in mind that there is a difference between Redirect 301 and 302. 301 means that the redirection is permanent, 302 only temporary.
For the example given above, the permanent redirection would look like this:
Redirect 301 /SE /SEO
Afterwards do not forget to Save changes in .htaccess!
From now on every visitor who tries to open a false URL will be redirected to the correct one.
Another option would be to open the search console under Y SEO. Similar to the Google Search Console the plug-in provides a list of affected segments. Furthermore you will know when your URLs have been checked, when the error had been detected for the first time and what kind of error it is.
In case you purchase the Premium-Version (starting at € 69 for one year updates + support), you can view the URL, activate a redirection or mark it as corrected directly in the list.
Special Redirect WP-Plug-ins
Finally WP offers several special plug-ins that work similar to the Premium-Version of Yoast SEO described above.
One of the most popular is Redirection von John Godley. The advantage of these plug-ins is that you can redirect URLs with relatively low expenditure. The disadvantage is that you have to install another plug-in which might have some impact on the loading time of your website.
Though 404 errors do not really harm your website, they are not very pleasant.
At least some of the errors can be avoided in advance. So you should think about the necessity before deleting a post and producing a dead link.
4 Keep the URL
Pay attention to not changing the URL when revising or updating your posts/pages.
5 Do not delete old posts
In many cases you can write a new post about a related topic, change the title, but keep the keyword(s) and the old URL. Scarcely anybody will compare the URL with the title of the post resp. many post/page titles do not literally match the URLs a priori.
When the list of errors is growing, redirect the URLs to a related post if possible and meaningful. And for all the others – set up a special page that helps your confused visitors.
As too many redirections may slow down your website, too, make up your mind whether a redirection is reasonable. If not, wait until the URL will be dropped down due to absent Google hits.