Register Advertise with usHelp Desk Today's Posts Search

Thread Tools Search this Thread
Unread 29th Apr 2014, 10:25 AM   #1
Active Warrior
War Room Member
 
Planning To Success's Avatar
 
Join Date: 2012
Posts: 33
Thanks: 7
Thanked 10 Times in 5 Posts
Default
How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

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

Hans and Merlijn present to you:

www.planningtosuccess.com
Planning To Success is offline   Reply With Quote
Unread 30th Apr 2014, 03:38 AM   #2
Helpful Programmer
 
Artur Golisz's Avatar
 
Join Date: 2011
Location: Poland
Posts: 38
Thanks: 10
Thanked 8 Times in 8 Posts
Default
Re: How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

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.
Artur Golisz is offline   Reply With Quote
Unread 30th Apr 2014, 04:55 AM   #3
Active Warrior
War Room Member
 
Planning To Success's Avatar
 
Join Date: 2012
Posts: 33
Thanks: 7
Thanked 10 Times in 5 Posts
Default
Re: How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

Yes, But how can I do that without a plugin?

Hans and Merlijn present to you:

www.planningtosuccess.com
Planning To Success is offline   Reply With Quote
Unread 30th Apr 2014, 04:12 PM   #4
ɹoıɹɹɐʍ ǝʌıʇɔɐɹǝdʎɥ
War Room Member
 
RobinInTexas's Avatar
 
Join Date: 2008
Location: Texas
Posts: 2,138
Thanks: 243
Thanked 453 Times in 382 Posts
Blog Entries: 3
Default
Re: How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

Why not just let WordPress return a 404 error? There's no advantage in using a 410.

Robin


...Even if you're on the right track, you'll get run over if you just set there.
RobinInTexas is offline   Reply With Quote
Unread 17th Sep 2014, 11:02 PM   #5
Warrior Member
 
Join Date: 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

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.
dccharron is offline   Reply With Quote
Unread 24th Sep 2014, 05:43 AM   #6
Warrior Member
 
newgadget123's Avatar
 
Join Date: 2014
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

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.
newgadget123 is offline   Reply With Quote
Unread 24th Sep 2014, 12:16 PM   #7
Active Warrior
 
Join Date: 2014
Location: Toronto, Canada
Posts: 33
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

You can simply modify the header information via header('...'); clean the output buffer, set the appropriate header and exit();

Hope this helps.

Mr Alexander

Web Developer & Consultant with extensive experience, since 1998

Websites.Consulting
mralexanderca is offline   Reply With Quote
Unread 21st Sep 2017, 09:07 AM   #8
Warrior Member
 
Join Date: 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default
RE: How to create a 410 page in wordpress
Share on: 
fb share twitter share gplus share more share

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.
nofame is offline   Reply With Quote


Bookmarks

Tags
410, create, page, wordpress


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 05:17 AM.