{"id":282,"date":"2009-07-01T23:58:01","date_gmt":"2009-07-01T18:28:01","guid":{"rendered":"http:\/\/www.bin-co.com\/blog\/?p=282"},"modified":"2009-07-01T23:58:01","modified_gmt":"2009-07-01T18:28:01","slug":"create-a-better-404-page-in-wordpress-without-plugins","status":"publish","type":"post","link":"https:\/\/www.bin-co.com\/blog\/2009\/07\/create-a-better-404-page-in-wordpress-without-plugins\/","title":{"rendered":"Create a Better 404 Page in WordPress &#8211; Without Plugins"},"content":{"rendered":"<p><a href=\"http:\/\/www.flickr.com\/photos\/willemvelthoven\/251801449\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.bin-co.com\/blog\/wp-content\/uploads\/2009\/07\/404.jpg\" alt=\"404\" title=\"404\" width=\"300\" height=\"197\" class=\"aligncenter size-full wp-image-283 intro\" align=\"right\" \/><\/a><\/p>\n<p class=\"intro\">Recently, one of my friends posted a <a href=\"http:\/\/www.dailyseoblog.com\/2009\/06\/8-wordpress-plugins-to-make-your-404-error-pages-user-friendly-efficient\/\">list of plugins you can use to optimize your 404 page<\/a>. In case you don&#8217;t know what a <strong class=\"highlight\">404 page, its the page that shows up if the URL requested by the user don&#8217;t exist<\/strong>. He listed eight plugins to do this. And since I am working on the <a href=\"http:\/\/www.bin-co.com\/blog\/2009\/03\/wordpress-plugin-killer-series\/\">Plugin Killer series<\/a>, it got me thinking &#8211; is it possible to do it without using any plugins?<\/p>\n<p>Turns out, its easy. As long as you know about the <strong class=\"highlight\"><a href=\"http:\/\/www.google.com\/support\/webmasters\/bin\/answer.py?answer=136085\">Google&#8217;s 404 Widget<\/a>. It adds a search box for your site with appropriate search suggestions<\/strong> and tries(and unfortunately, often fails) to provide alternatives to incorrect URLs.<\/p>\n<p>See it in action here &#8211; <a href=\"http:\/\/www.bin-co.com\/perl\/perl_tk_tutorials\/\" rel=\"nofollow\">http:\/\/www.bin-co.com\/perl\/perl_tk_tutorials\/<\/a>. The correct URL is <a href=\"http:\/\/www.bin-co.com\/perl\/perl_tk_tutorial\/\">http:\/\/www.bin-co.com\/perl\/perl_tk_tutorial\/<\/a> &#8211; which the user finds and shows.<\/p>\n<h2>Enable Google 404 Widget in your Site<\/h2>\n<ul>\n<li>First, <strong class=\"highlight\">create the code<\/strong> by following the steps given in the <a href=\"http:\/\/www.google.com\/support\/webmasters\/bin\/answer.py?answer=136085\">404 Widget page<\/a>.<\/li>\n<li>Then open the <strong class=\"highlight\">404.php file of your wordpress theme and paste the code<\/strong> you got into it. Save and upload &#8211; you&#8217;re done.<\/li>\n<\/ul>\n<p>This is the last of my plugin killer series. Just to balance things out, I&#8217;m thinking of doing a <a href=\"http:\/\/www.bin-co.com\/blog\/2008\/12\/wordpress-plugin-week\/\">Plugin week<\/a>(yes, <strong class=\"highlight\">a second plugin week<\/strong>) next week. Let me know if any of you are interested.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Recently, one of my friends posted a <a href=\"http:\/\/www.dailyseoblog.com\/2009\/06\/8-wordpress-plugins-to-make-your-404-error-pages-user-friendly-efficient\/\">list of plugins you can use to optimize your 404 page<\/a>. In case you don&#8217;t know what a <strong class=\"highlight\">404 page, its the page that shows up if the URL requested by the user don&#8217;t exist<\/strong>. He listed eight plugins to do this. And since I am working on the <a href=\"http:\/\/www.bin-co.com\/blog\/2009\/03\/wordpress-plugin-killer-series\/\">Plugin Killer series<\/a>, it got me thinking &#8211; is it possible to do it without using any plugins?<\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,28,31],"tags":[212,213,251,304,308],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-scripts","category-tutorial","category-wordpress","tag-plugin","tag-plugin-killer","tag-series","tag-wordpress","tag-wp-plugin"],"_links":{"self":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/comments?post=282"}],"version-history":[{"count":0,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/posts\/282\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/media?parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/categories?post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bin-co.com\/blog\/wp-json\/wp\/v2\/tags?post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}