Sometime back, I’d written a post that how can one utilize WordPress template system and customize a 404 error page and ensure that the visitors will be able stick to your blog even if they end up landing on 404 page. Here’s a quick and simple tip which will help in ensuring that in case a visitor lands up on 404 page, they’ll be presented with an HTML based Sitemap with all the articles listed with categories.
Dagon Design has created a wonderful Sitemap plugin for WordPress (it’s not Google XML sitemap generator) but an HTML based sitemap generator which displays all the links to all the posts you’ve written on your blog and lists them according to their categories. This ensures that search engines will be able to follow all the links without any issues as they will be linked from this HTML page. It’s always good to have the XML sitemap and HTML based sitemap for your blog.
So, simply download the plugin and activate and use the help to ensure that you have a sitemap based on your blog and now the other part that how can you integrate this sitemap in 404 error page -
1. Upload and activate the plugin.
2. Go to Design->Theme Editor.
3. Look for 404 Template on the right hand side & click on it.
4. Paste the following line in the post display area – < ?php echo ddsg_create_sitemap(); ? > (remove the spaces after and before < & >).
5. Save the file and that’s it.
Whenever a person will land on the 404 error page, they’ll get to see the whole sitemap and thus the chances are they’ll stick to your blog.