For that, usually a blog or web create a page or landing page specifically for error 404 page by giving a statement that the destination page has been deleted or no longer exists. The rest is given a button to the homepage or provided a search box to search for the desired post again.
Now this time I will give a trick to automatically redirect or redirect the error 404 page to the compilation so that visitors do not need to click the button to the homepage.
Actually, posts like this have a lot on Google, but there are Blogboosters friends who have difficulty implementing it because the script does not work in some templates, especially templates that use conditional tags for error 404 pages.
1. For non AMP blogs
The above code will automatically redirect the error 404 page to the homepage after 8 seconds so that visitors can still read the message on the error 404 page, you can set/change the number 8000to set the waiting time. 1 second = 1000.
If you want to directly redirect, use the following code.
Read Also: How to Make Script Boxes in Blog Posts
2. For blogs that use mobile URLs? M = 1 as AMP, use the following code that will only apply to desktop URLs
3. This can also be used in Wordpress, please save this code in the 404.php section at the bottom.
Read Also: Creating Sub Domains from Custom Domain Blogspot