1

How do i serve 410 status code over 404 in joomla? So that google will de-index my pages from serach results.

Please provide all methods in detail.

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144

2 Answers2

0

You would have to do this in the .htaccess. Similar format to 301 redirects but only putting the URL you want to disappear. Please note, this can still take months.

Redirect 410 /old-page-you-do-not-want


Also, make sure you are updating your robots.txt to suggest to search engines to not crawl:

Disallow: /old-page-you-do-not-want
YellowWebMonkey
  • 1,101
  • 7
  • 7
  • @Yatin Arora, That is Google's recommendation although there isn't much preference to a 410 vs 404*. For temporarily getting it to disappear, you can use the [link](https://support.google.com/webmasters/answer/1663419?hl=en) Remove URLs tool, although use it sparingly. Those are only temporary so you need to check back frequently to see if the request has expired. *https://searchenginewatch.com/sew/how-to/2340728/matt-cutts-on-how-google-handles-404-410-status-codes – YellowWebMonkey Mar 15 '17 at 19:02
  • should i write like this like i wanna remove food or abour related pages so my code will be Redirect 410 /food or Redirect 410 /about is that correct..!! – Yatin Arora Mar 17 '17 at 07:36
0

Not sure why your original question was downvoted. In any case, please check this post on the right way to return 404 in Joomla. Then, when implementing the post, replace the following line:

header('HTTP/1.0 404 Not Found');

with

header('HTTP/1.0 410 Gone');

I am not 100% sure that returning 410 instead of 404 for everything is a good idea though.

itoctopus
  • 4,133
  • 4
  • 32
  • 44
  • he asks for 410 probably as he received an email from Google with the following title: Increase in “soft-404” pages on http://www.example.com In this email it is suggested to implement a solution for 404 or 410 (gone). – Yannis Dran Nov 28 '18 at 08:15