{"id":735,"date":"2012-08-25T17:10:55","date_gmt":"2012-08-25T08:10:55","guid":{"rendered":"http:\/\/www.santoshkori.com\/blog\/?p=735"},"modified":"2012-08-26T21:21:42","modified_gmt":"2012-08-26T12:21:42","slug":"create-make-a-helpful-wordpress-404-page","status":"publish","type":"post","link":"https:\/\/www.santoshkori.com\/blog\/create-make-a-helpful-wordpress-404-page\/","title":{"rendered":"Create\/ Make A Helpful WordPress 404 Page"},"content":{"rendered":"<p>When your server can&#8217;t find the requested page it will return a HTTP status code of 404. This tells the browser that the request has failed because the page you are asking for can not be found.\u00a0When your server returns a 404 this needs to be handled so that your not just displaying the default browser page.<\/p>\n<p><!--more-->Normally this will be done with htaccess by detecting a 404 error and redirecting the user to your own 404 page.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">ErrorDocument 404 \/404.html<\/pre>\n<p>If you use <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\">WordPress<\/a><\/span> then this 404 redirecting is already built into the core. When <span style=\"text-decoration: underline;\"><strong><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\">WordPress<\/a><\/strong><\/span> can&#8217;t find your page it will redirect the page to your <span style=\"text-decoration: underline;\"><strong><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\">WordPress<\/a><\/strong><\/span> 404 page.<\/p>\n<p><strong>To create a 404 page in WordPress<\/strong> all you have to do is create a new file in the root of your theme and name it 404.php.<\/p>\n<p>Now that we have a page which will be displayed we need to customise this so that it&#8217;s helpful to your visitors. It&#8217;s good for the visitors to understand why they have got to this page, what this page means and what to do next.<\/p>\n<h3>Default WordPress 404<\/h3>\n<p>The default 404 page that comes with <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\"><strong>WordPress<\/strong><\/a><\/span> will display your theme header, sidebar, footer and a page title.<\/p>\n<h3 class=\"center\">Error 404 &#8211; Not Found<\/h3>\n<p>This tells your visitor what has gone wrong and that the page is not found but it doesn&#8217;t give them anything extra to do, where are they suppose to go from here?<\/p>\n<h3>Add Useful Links<\/h3>\n<p>When the above 404 page is displayed the visitor is stuck with nothing to do but go back to your home page or click away from your site. The 404 page is a perfect place to add some useful links to help your visitors find what they are looking for.<\/p>\n<p><strong>Add links to your posts<\/strong><br \/>\n<strong>Add links to your categories<\/strong><br \/>\n<strong>Add links to your author pages<\/strong><br \/>\n<strong>Add links to your archives<\/strong><br \/>\n<strong>You could even add a search box to the page.<\/strong><\/p>\n<h3>Display List Of Page<\/h3>\n<p>In <span style=\"text-decoration: underline;\"><strong><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\">WordPress<\/a><\/strong><\/span> here is code to display a list of pages use the wp_list_pages() function.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">wp_list_pages( 'title_li=' );<\/pre>\n<h3>Display List Of Categorie<\/h3>\n<p>In\u00a0<span style=\"text-decoration: underline;\"><strong><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\">WordPress<\/a><\/strong><\/span>\u00a0here is code to\u00a0display a list of categories use the wp_list_categories() function.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">wp_list_categories( 'sort_column=name&amp;title_li=' );<\/pre>\n<h3>Display List Of Authors<\/h3>\n<p>Use the wp_list_authors() function to display a list of all authors in <span style=\"text-decoration: underline;\"><strong><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\">WordPress<\/a><\/strong>\u00a0<\/span>.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">wp_list_authors( 'exclude_admin=0&amp;optioncount=1' );<\/pre>\n<h3>Display Your Monthly Archives<\/h3>\n<p>Display a list of archives by month by using the function wp_get_archives() with the parameter type=monthly.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">wp_get_archives( 'type=monthly' );<\/pre>\n<h3>Display Search Form<\/h3>\n<p>To display the <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\"><strong>WordPress<\/strong> <\/a><\/span>search form use the function get_search_form(). This will search your theme folder for a file named searchform.php if it exists this function will return this file. If this file doesn&#8217;t exist then it will return the default <span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.santoshkori.com\/blog\/tag\/mumbai-wordpress-freelancer\/\"><strong>WordPress<\/strong><\/a><\/span> form.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">get_search_form();<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When your server can&#8217;t find the requested page it will return a HTTP status code of 404. This tells the browser that the request has failed because the page you are asking for can not be found.\u00a0When your server returns a 404 this needs to be handled so that your not just displaying the default [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[356,358,357,725],"class_list":["post-735","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-create-a-helpful-wordpress-404-page","tag-helpful-wordpress-404-page","tag-make-a-helpful-wordpress-404-page","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/735","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/comments?post=735"}],"version-history":[{"count":7,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/735\/revisions"}],"predecessor-version":[{"id":737,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/735\/revisions\/737"}],"wp:attachment":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/media?parent=735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/categories?post=735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/tags?post=735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}