Mobile app version of vmapp.org
Login or Join
Alves908

: How to return error 404 on non existent page on WordPress? My site got hacked last month and a lot of PDFs were added in Google ending in /index.php?voxter.pdf&gpvoq=1&static=1866. I have

@Alves908

Posted in: #Error #Wordpress

My site got hacked last month and a lot of PDFs were added in Google ending in /index.php?voxter.pdf&gpvoq=1&static=1866.

I have cleaned the site but now these pages are redirecting to home page instead of returning error 404. As a result, these pages are still there in Google Search results. Whenever I use /index.php?voxter.pdf&gpvoq=1&static=1866 this at any WordPress site, it shows homepage only.

But my question is why Google is showing these non existent pages in search results?

One argument can be Gogle previously indexed these pages so it wont remove it from results till they return error 404. How can I make these pages to return error 404?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

2 Comments

Sorted by latest first Latest Oldest Best

 

@Berumen354

Wordpress themes support 404 page. You can see the full documentation here codex.wordpress.org/Creating_an_Error_404_Page
It is also useful to display proper http status code 404 while displaying 404 error page.

10% popularity Vote Up Vote Down


 

@Berumen354

There are a range of plugins you can add to your WordPress installation which will trigger a 404 error instead of redirecting to the homepage when a page could not be found. I am not going to recommend one as ProWebmasters is not designed for recommending software or plugins but what I will do is give you this link www.lmgtfy.com/?q=wordpress+hard+404+plugin which will take you the Google search for hard 404 plugins for WordPress.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme