Add Wayback Machine Archive Links to 404 Error Pages

Would it not be nice if you could have links on 404 Error pages pointing to Wayback machine links on how the pages looked like in the past. Of course there can be no better way for doing this than adding a single line of code which will check the 404 link for  an archived url.

The Wayback machine ( archives all your websites at different time periods and has true snapshots of your webpages. It is the best way to find how webpages looked like in the past. When your links go awry, and you are not able to fix all of them, why not point visitors to links of how the page actually looked like in the past.

Add Links

They suggest you simply add the following code in your 404 page template. In WordPress, you can add in the 404.php file while editing your theme template.

<div id="wb404"/>
<script src=""> </script>

Now when a visitor visits a page which has been indexed in the Wayback machine, it will display the link to the latest copy they stored. See how it looks on our 404 pages right now.

wayback archive links

Note:  If it is a random url, and the script cannot find the link, then it will display a blank space and stay out of the way, which is good.

When not to do this? If you add this to your 404 page template, the code will display on all 404 pages which have a Archived link. You would not like to implement this feature if you have purposefully deleted the urls and force 404 errors, to fix Google penalties or maybe the page is actually gone and you want to display a 410 gone error purposefully.


  1. Lamia khan says:

    Thanks For guide
    it is very useful In 404 error page
    Nice sharing
    Keep up it

  2. Sachin says:

    Hii Chandra
    i solve my site 404 problem with awesome article
    Thanks sharing for help
    Have good day

  3. john parkar says:

    Nice share and i solve my websites 404 problem.
    Thanks for this article

  4. Suresh Prasad says:

    Oh! It’s great info. It may help those users having old/deleted post URL. Recently, I created a custom 404 errors page for blogger blog users but I Wayback Machine has not come to my mind.

    Thanks for this story. Today, I learned something new from your site.

  5. semavideo says:

    Honestly I have not thought much of this. On the contrary, I honestly did not even know. Text Archive Links to 404 Error Pages has really helped me to get to know this subject, and I think that will help me in the work that I do. Thanks a lot, and regards

  6. rasel says:

    Nice share and i solve my websites 404 problem.
    Thanks for this article

  7. Nayim Ur Rahman says:

    Thanks for sharing this with us. We didn’t know well about 404 Error. So your post can help us.

  8. Jhon K says:

    Hey .. it’s a great way to deal with 404pages. Thanks for the tutorial.

Leave a Reply

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