How to override default WordPress 404 Page with a custom one?

The reason why I can’t use the normal 404.php WordPress template file is because of my host. An IP (crawler maybe) kept viewing 404 pages and sending SQL queries I guess. Since I’m on a shared host, they told me to install WP Super Cache (which I did) and add an ErrorDocument 404 directive in my htaccess file but that doesn’t work.

Where it should be added so it overrides WP default one?

Read More

In the meantime, I’ve changed the 404.php to a simple html file. That won’t send any SQL requests right?

Thanks a lot,
Cris

Related posts

Leave a Reply

1 comment

  1. The 404 page (including the default one from WP) shouldn’t be firing SQL queries. It’s the page you end up on when the SQL has already determined it can’t find what’s being asked for.

    One common reason for high SQL activity is how you’ve defined your permalink structure. It’s tempting (but deadly) to use “postname”. It’s the most common way I can think of to get yourself into this kind of a problem.

    But I’m sure there are more I haven’t discovered yet…