The simple cure if a Wordpress custom content type doesn't display, but gives a 404 page not found

; Date: Thu Mar 17 2016

Tags: Wordpress

Sometimes custom content types stop displaying, on a Wordpress site.

In my case, my server had been hacked and everything wiped, so much so that I didn't have a proper database backup but instead raw MySQL data files from which to restore the site. After restoring the website, everything was functioning EXCEPT pages from a custom content type for a plugin I'd coded. Every page I checked, instead of displaying, gave a page not found error (404 error code). Immediately before the hack this custom content type worked perfectly, and some of the most popular pages on (longtailpipe.com) LongTailPipe were implemented with this custom content type.

Searching the Internet didn't turn up much. Some were discussing which template files to use. That would be the thing to check while developing the custom content type. But, I'd already made it past that consideration, because the code had been written months ago and was already well tested.

But, I saw a comment on one such posting: Go to the Permalinks settings and click SAVE.

I did, and presto the custom content type pages started working perfectly.

Process:

  • In the Wordpress dashboard - navigate to Settings / Permalinks
  • Click Save

That's it.

Apparently doing so will update your permalinks settings and flush rewrite rules. I suppose the process of bringing my site back to life caused unwanted changes in the rewrite rules. Initially Wordpress decided to disable some things because two plugins (including this one) were missing.

About the Author(s)

(davidherron.com) David Herron : David Herron is a writer and software engineer focusing on the wise use of technology. He is especially interested in clean energy technologies like solar power, wind power, and electric cars. David worked for nearly 30 years in Silicon Valley on software ranging from electronic mail systems, to video streaming, to the Java programming language, and has published several books on Node.js programming and electric vehicles.