Above screenshot is a 404 page on labnol.org, it is a custom-made page that makes more sense than a usual 404 page. A normal 404 page in WordPress doesn’t make much sense. I use Thesis theme, in this theme the error page can be edited, but still, it’s not very useful. A 404 page is technically content less because it appears only if a page is missing. So in a 404 page, adding recent posts, tags and categories is somewhat useful but we can do something better. We can create a 404 page from scratch in a much more creative way.
I also have created a Labnol like 404 page, you can see it in the below screenshot.
How to get started?
(1) Create an HTML page and save as .php
Create an HTML page using any WYSIWYG html editor and save it as 404.php instead of 404.html. While creating this page, you can add whatever you want as blog logo and link it to homepage, add a Google search box, add some message, and anything that is good to add.
TechShali 404 page is not creative, it is the same Labnol page with some changes.
(2) Login to hosting account via FTP
You can use any FTP client to login to your web hosting account and access the folder where wordpress is installed. WordPress installation can be in root directory (folder) or in any folder in the root. In the wordpress installation folder you can find wp-admin, wp-content and wp-includes files. In this folder look for .htaccess file and download it. After downloading the .htaccess file open it in a notepad and add below line in it.
ErrorDocument 404 /404.php
You need to be careful while adding this line, you can see below screenshot to get the idea how I did it.
After adding this line save the file, and upload it to the same folder from where you have downloaded it. You can rename the old file on server from .htaccess to .htaccess1 instead of overwriting on it. So if something happens to your blog you can just delete the new file and rename the old file from .htaccess1 to .htaccess.
(3) Access your current theme folder and upload 404.php into it
As you have already logged in to server via FTP, you have to get access to current theme folder. In the theme folder there can be more than one theme but you have to open the current theme folder. To open theme folder follow these steps.
Go to wordpress installation folder> wp-content>themes> your current theme
As you have already created a 404.php, now upload it to current theme folder.
If you have followed all the instructions carefully, you have successfully created a Labnol like 404 page.