{"id":165,"date":"2009-03-12T09:46:54","date_gmt":"2009-03-12T15:46:54","guid":{"rendered":"http:\/\/credible-content.com\/blog\/404-page-in-wordpress\/"},"modified":"2009-03-12T09:46:54","modified_gmt":"2009-03-12T15:46:54","slug":"404-page-in-wordpress","status":"publish","type":"post","link":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/","title":{"rendered":"Creating a page not found 404 error page if you are managing your website with WordPress"},"content":{"rendered":"<p>About a couple of months ago I put my entire website into WordPress&#8230;now every page on this website is actually a WordPress blog post. This makes it very easy to add new content and modify existing content, and it is also good for SEO (it is already manifest in my stats). Besides, whenever I want to change the layout\/design, I simply have to create a new WordPress theme, and then activate it using the WordPress control panel\/admin area.<\/p>\n<p>After a few days I noticed that my 404 page was not working. Wondering what&#8217;s a 404 page? 404 is the error number that is generated when a visitor comes to your website using a link that does not exist on your website. For instance, on my website, if you click on a link <a href=\"http:\/\/credible-content.com\/doesntexist\/\">http:\/\/credible-content.com\/doesntexist\/<\/a> you will be redirected to <a href=\"http:\/\/credible-content.com\/404-page\/\">http:\/\/credible-content.com\/404-page\/<\/a> because &quot;doesntexist&quot; doesn&#8217;t exist on my website.<\/p>\n<p>On normal websites you can add the following line in your .htaccess file:<\/p>\n<p><em>ErrorDocument 404 <\/em><a href=\"http:\/\/credible-content.com\/404-page\/\"><em>http:\/\/credible-content.com\/404-page\/<\/em><\/a><\/p>\n<p>You need to store your .htaccess file in the root folder I guess. But this doesn&#8217;t work if you are managing your website with WordPress; somehow it doesn&#8217;t redirect the page using .htaccess file.&#160;&#160; After some research I found that WordPress uses its own 404.php file to display the &quot;page not found&quot; page and you have to store this file in the folder where you&#8217;ve stored all your theme files, like \/blog-url\/wp-content\/themes\/your-theme-folder\/404.php.<\/p>\n<p>But what if you want to display a page or blog post that you&#8217;ve already created, if someone comes on a non-existent page? It&#8217;s very simple. Delete whatever you have in your 404.php file and instead, have this php line inserted:<\/p>\n<p><em>&lt;?php header(&quot;Location: \/404-page\/&quot;); ?&gt;<\/em><\/p>\n<p>Please remember that \/404-page\/ is something what I&#8217;ve created for my website; you may have something else.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>About a couple of months ago I put my entire website into WordPress&#8230;now every page on this website is actually a WordPress blog post. This makes it very easy to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[550,553],"class_list":["post-165","post","type-post","status-publish","format-standard","hentry","category-seo","tag-seo","tag-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating a page not found 404 error page if you are managing your website with WordPress - Credible Content Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a page not found 404 error page if you are managing your website with WordPress - Credible Content Blog\" \/>\n<meta property=\"og:description\" content=\"About a couple of months ago I put my entire website into WordPress&#8230;now every page on this website is actually a WordPress blog post. This makes it very easy to...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Credible Content Writing &amp; SEO Copywriting Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CredibleContent\" \/>\n<meta property=\"article:author\" content=\"http:\/\/facebook.com\/amrithallan\" \/>\n<meta property=\"article:published_time\" content=\"2009-03-12T15:46:54+00:00\" \/>\n<meta name=\"author\" content=\"Amrit Hallan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@amrithallan\" \/>\n<meta name=\"twitter:site\" content=\"@ContentGyan\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amrit Hallan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/\"},\"author\":{\"name\":\"Amrit Hallan\",\"@id\":\"https:\/\/credible-content.com\/blog\/#\/schema\/person\/ca0b0af763e9f25438545eee2a328607\"},\"headline\":\"Creating a page not found 404 error page if you are managing your website with WordPress\",\"datePublished\":\"2009-03-12T15:46:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/\"},\"wordCount\":339,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/credible-content.com\/blog\/#organization\"},\"keywords\":[\"SEO\",\"wordpress\"],\"articleSection\":[\"SEO\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/\",\"url\":\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/\",\"name\":\"Creating a page not found 404 error page if you are managing your website with WordPress - Credible Content Blog\",\"isPartOf\":{\"@id\":\"https:\/\/credible-content.com\/blog\/#website\"},\"datePublished\":\"2009-03-12T15:46:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/credible-content.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a page not found 404 error page if you are managing your website with WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/credible-content.com\/blog\/#website\",\"url\":\"https:\/\/credible-content.com\/blog\/\",\"name\":\"Credible Content Writing &amp; SEO Copywriting Blog\",\"description\":\"Looking for insightful blog posts on content writing, and SEO copywriting? You will find them on Credible Content Blog. Updated almost daily. Fresh, unique perspective.\",\"publisher\":{\"@id\":\"https:\/\/credible-content.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/credible-content.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/credible-content.com\/blog\/#organization\",\"name\":\"Credible Content Blog\",\"url\":\"https:\/\/credible-content.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/credible-content.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/credible-content.com\/blog\/wp-content\/uploads\/2017\/08\/favicon.png\",\"contentUrl\":\"https:\/\/credible-content.com\/blog\/wp-content\/uploads\/2017\/08\/favicon.png\",\"width\":64,\"height\":64,\"caption\":\"Credible Content Blog\"},\"image\":{\"@id\":\"https:\/\/credible-content.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/CredibleContent\",\"https:\/\/x.com\/ContentGyan\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/credible-content.com\/blog\/#\/schema\/person\/ca0b0af763e9f25438545eee2a328607\",\"name\":\"Amrit Hallan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/credible-content.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/01934511b40b5cdd1de173ca248ca67683477b23e1f93def6bd8c9ff9a9665f7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/01934511b40b5cdd1de173ca248ca67683477b23e1f93def6bd8c9ff9a9665f7?s=96&d=mm&r=g\",\"caption\":\"Amrit Hallan\"},\"description\":\"Amrit Hallan is a professional content writer who helps businesses improve their conversion rate through credible and compelling content writing. His main strength lies in writing search engine optimized content without compromizing quality and meaningfulness.\",\"sameAs\":[\"https:\/\/credible-content.com\",\"http:\/\/facebook.com\/amrithallan\",\"https:\/\/x.com\/amrithallan\"],\"url\":\"https:\/\/credible-content.com\/blog\/author\/amrithallan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a page not found 404 error page if you are managing your website with WordPress - Credible Content Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Creating a page not found 404 error page if you are managing your website with WordPress - Credible Content Blog","og_description":"About a couple of months ago I put my entire website into WordPress&#8230;now every page on this website is actually a WordPress blog post. This makes it very easy to...","og_url":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/","og_site_name":"Credible Content Writing &amp; SEO Copywriting Blog","article_publisher":"https:\/\/www.facebook.com\/CredibleContent","article_author":"http:\/\/facebook.com\/amrithallan","article_published_time":"2009-03-12T15:46:54+00:00","author":"Amrit Hallan","twitter_card":"summary_large_image","twitter_creator":"@amrithallan","twitter_site":"@ContentGyan","twitter_misc":{"Written by":"Amrit Hallan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/"},"author":{"name":"Amrit Hallan","@id":"https:\/\/credible-content.com\/blog\/#\/schema\/person\/ca0b0af763e9f25438545eee2a328607"},"headline":"Creating a page not found 404 error page if you are managing your website with WordPress","datePublished":"2009-03-12T15:46:54+00:00","mainEntityOfPage":{"@id":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/"},"wordCount":339,"commentCount":1,"publisher":{"@id":"https:\/\/credible-content.com\/blog\/#organization"},"keywords":["SEO","wordpress"],"articleSection":["SEO"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/","url":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/","name":"Creating a page not found 404 error page if you are managing your website with WordPress - Credible Content Blog","isPartOf":{"@id":"https:\/\/credible-content.com\/blog\/#website"},"datePublished":"2009-03-12T15:46:54+00:00","breadcrumb":{"@id":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/credible-content.com\/blog\/404-page-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/credible-content.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating a page not found 404 error page if you are managing your website with WordPress"}]},{"@type":"WebSite","@id":"https:\/\/credible-content.com\/blog\/#website","url":"https:\/\/credible-content.com\/blog\/","name":"Credible Content Writing &amp; SEO Copywriting Blog","description":"Looking for insightful blog posts on content writing, and SEO copywriting? You will find them on Credible Content Blog. Updated almost daily. Fresh, unique perspective.","publisher":{"@id":"https:\/\/credible-content.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/credible-content.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/credible-content.com\/blog\/#organization","name":"Credible Content Blog","url":"https:\/\/credible-content.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/credible-content.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/credible-content.com\/blog\/wp-content\/uploads\/2017\/08\/favicon.png","contentUrl":"https:\/\/credible-content.com\/blog\/wp-content\/uploads\/2017\/08\/favicon.png","width":64,"height":64,"caption":"Credible Content Blog"},"image":{"@id":"https:\/\/credible-content.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CredibleContent","https:\/\/x.com\/ContentGyan"]},{"@type":"Person","@id":"https:\/\/credible-content.com\/blog\/#\/schema\/person\/ca0b0af763e9f25438545eee2a328607","name":"Amrit Hallan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/credible-content.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/01934511b40b5cdd1de173ca248ca67683477b23e1f93def6bd8c9ff9a9665f7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/01934511b40b5cdd1de173ca248ca67683477b23e1f93def6bd8c9ff9a9665f7?s=96&d=mm&r=g","caption":"Amrit Hallan"},"description":"Amrit Hallan is a professional content writer who helps businesses improve their conversion rate through credible and compelling content writing. His main strength lies in writing search engine optimized content without compromizing quality and meaningfulness.","sameAs":["https:\/\/credible-content.com","http:\/\/facebook.com\/amrithallan","https:\/\/x.com\/amrithallan"],"url":"https:\/\/credible-content.com\/blog\/author\/amrithallan\/"}]}},"_links":{"self":[{"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":0,"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"wp:attachment":[{"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/credible-content.com\/blog\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}