| | #1 |
| Active Warrior War Room Member Join Date: 2012
Posts: 33
Thanks: 7
Thanked 10 Times in 5 Posts
|
Hi, Does anybody know how I can create a 410 page in wordpress? I am able to add and edit template files etc. I looked on Google but I found nothing I can use. My site was hacked and now I have some pages indexed that need to return a 410 error, because those pages do not exist. Is there something I need to add to my template or functions.php to ensure it will work. I prefer to not use a plugin for this function. Thanks in advance, Hans |
| | |
| | |
| | #2 |
| Helpful Programmer Join Date: 2011 Location: Poland
Posts: 38
Thanks: 10
Thanked 8 Times in 8 Posts
|
So you need a plugin where you can add url which should return 410 (http status)?
|
| Need help with programming (WordPress, PHP, jQuery and more) ? Just send me PM. | |
| | |
| | #3 |
| Active Warrior War Room Member Join Date: 2012
Posts: 33
Thanks: 7
Thanked 10 Times in 5 Posts
|
Yes, But how can I do that without a plugin?
|
| | |
| | |
| | #4 |
| ɹoıɹɹɐʍ ǝʌıʇɔɐɹǝdʎɥ War Room Member Join Date: 2008 Location: Texas
Posts: 2,138
Thanks: 243
Thanked 453 Times in 382 Posts
Blog Entries: 3 |
Why not just let WordPress return a 404 error? There's no advantage in using a 410.
|
|
Robin | |
| | |
| | #5 |
| Warrior Member Join Date: 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
Actually there is a huge difference between 404 and 410. When a web crawler gets a 404, it logs the error. When a web crawler gets a 410, it logs the error and removes the page from its index. So a 404 gets repeated over and over by the crawler. A 410 only happens once. There's a plugin for wordpress called "410 for Wordpress". I use it and it works. I tailored the response to look like the one generated by a 404 by copying the 404.php file and tinkering a bit with it. I'd recommend. |
| | |
| | #6 |
| Warrior Member Join Date: 2014
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
| we can create 410 page in wordpress by using a plugin that sends http 410 responses to requests for pages which are no longer exist on your site. |
| | |
| | #7 |
| Active Warrior Join Date: 2014 Location: Toronto, Canada
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
|
You can simply modify the header information via header('...'); clean the output buffer, set the appropriate header and exit(); Hope this helps. |
| | |
| | |
| | #8 |
| Warrior Member Join Date: 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
I have a solution that doesn't rely on plugins.... this can be handled outside of wordpress at the server level. 1. Edit .htacccess and add the "gone" directive for every URL you want to 410: Redirect gone /mexico Redirect gone /viagra ... etc. 2. Then setup a custom 410 error document: ErrorDocument 410 /missing410.html 3. Then make a simple themed document and place it in your root directory (name it missing410.html). I just loaded copy/pasted the source code from my homepage and cut out everything in the header and body, and added some content to it. Just make sure it has a page title of 410 Gone and an H1 410 Gone, then you can tell users to click on the sidebar / search / etc. Your server will serve the custom 410 page along with the 410 HTTP headers that tells search engines the resource is gone. |
| | |
| Bookmarks |
| Tags |
| 410, create, page, wordpress |
| |