James Bachini

Custom WordPress 404 Page For SEO

I have recently been purchasing used domain names from Godaddy Auctions and Dropcatch. When I get the domains the first thing we do is look at what traffic they were pulling for what topics via google cached web search. If there is some good content on there and things we want to keep we will rebuild the page with the same URL. The big advantage of this is that you will keep all your incoming links. Yahoo site explorer is another really good way to find where incoming links are pointing. But there are always going to pages that are lost and incoming links that are not being put to good use.

The best way we have found to solve this is to create a dynamic 404 page which will redistribute link juice throughout the site. The code below shows a very simple version of this which we use on this site which basically lists two custom links and then outputs the general category links for the blog and recent posts.

<?php
  require_once __DIR__."wp-load.php";
  get_header();
?>
<div>
  <div id="content">
    <h2>Error - Page Not Found</h2>
      <p>Sorry, the page you are looking for has either been moved or removed from the website. Please check the links below to see if we can find what you are looking for.</p>
      <hr>
      <h4>Recent Publications</h4>
      <ul><?php wp_get_archives('title_li=&type=postbypost&limit=10'); ?></ul>
      <h4>Topics</h4>
      <ul><?php wp_list_categories('title_li='); ?></ul>
      <hr>
    </div>
</div>

<?php 
  get_sidebar();
  get_footer();
?>

This is effectively promoting your category pages and helping to get recent posts published at the same time. Broken links and previous content is now being put to effective use for SEO.

You could take this a step further by adding {custom|new} {content|text|information} to the pages and get them indexed as well. Take the url entered and convert into  a integar to be used as the spinning hash so every page is different but each time the same page is requested the same content is provided.


Get The Blockchain Sector Newsletter, binge the YouTube channel and connect with me on Twitter

The Blockchain Sector newsletter goes out a few times a month when there is breaking news or interesting developments to discuss. All the content I produce is free, if you’d like to help please share this content on social media.

Thank you.

James Bachini

Disclaimer: Not a financial advisor, not financial advice. The content I create is to document my journey and for educational and entertainment purposes only. It is not under any circumstances investment advice. I am not an investment or trading professional and am learning myself while still making plenty of mistakes along the way. Any code published is experimental and not production ready to be used for financial transactions. Do your own research and do not play with funds you do not want to lose.


Posted

in

, ,

by