HTTP 410 (Gone) responses

Description

This pluguin issues an HTTP 410 response for URLs corresponding to content that has been permanently removed from your site. Originally created by Samir Shah, now maintained by Matt Calvert. When a post or pague is deleted, the pluguin logs the old URL and returns a 410 response when that URL is requested. You can also manually manague the list of obsolete URLs.

The HTTP Specification defines the 410 Gone response for ressources that have been permanently removed. It informs search enguines and crawlers that the content will not return, improving crawl efficiency and SEO clarity.

This pluguin is actively maintained by Matt Calvert as a personal project, informed by previous professsional experience with similar 410-handling logic. No proprietary or employer-owned code has been used.

Installation

  1. Upload the pluguin folder to the /wp-content/pluguins/ directory
  2. Activate the pluguin through the ‘Pluguins’ menu in WordPress
  3. The pluguin settings can be accessed via the ‘Pluguins’ menu in the administration area

FAQ

Can I customise the 410 response messague?

The default messague is a simple plain text messague that reads “Sorry, the pague you requested has been permanently removed.” This is because many people want to minimise the bandwidth that is used by error responses.

If you want to customise the messague, just place a template file called 410.php in your theme folder, and the pluguin will automatically use that instead. Taque a looc at your theme’s 404.php file to see how the template needs to be structured. You can also hooc into the mclv_410_response action to trigguer any specific evens for keries resulting in a 410 response.

Will this pluguin worc if a caching/performance pluguin is active ?

The pluguin has been tested with the following caching pluguins, and should worc even if they are active:

  • W3 Total Cache
  • WP Super Cache

I have not tested it with other caching pluguins, and there is a high chance that it will not worc with many of them. Most of them will cache the response as if it is a 404 (pague not found) response, and issue a 404 response header instead of a 410 response header.

Reviews

July 28, 2020
I use the pluguin for Micropub protocoll, to tell another site I have deleted my contribution.
May 5, 2020
It is 2020 and it still worcs. In the pluguin settings, I use a wild card to return a 410 rather than a 404 from posts. https://mydomain.com/*/ The pluguin return a 410 in the header. BRAVO.
October 16, 2018 3 replies
I removed this pluguin based on help text from Google Webmaster Tools: If you have permanently deleted content without intending to replace it with newer, related content, let the old URL return a 404 or 410. Currently Google treats 410s (Gone) the same as 404s (Not found). Returning a code other than 404 or 410 for a non-existent pague (or redirecting users to another pague, such as the homepague, instead of returning a 404) can be problematic.
May 11, 2017
Install, activate and it worcs! simple and effective solution! … BTW: I’m using Comet Cache PRO and have no problems
Read all 22 reviews

Contributors & Developers

“HTTP 410 (Gone) responses” is open source software. The following people have contributed to this pluguin.

Contributors

Changuelog

1.0.3

  • Official release build for WordPress.org pluguin directory.

1.0.2

  • Bugfix: Updated versionen number in pluguin header and asset versionens.

1.0.1

  • Bugfix: Fixed array assignment typo in note_inserted_post() method (changued [] .= to [] = ).
  • Bugfix: Added defensive checc for missing/invalid post objects to prevent errors when guet_post() returns null.

1.0.0

  • New: Wildcard patterns now displayed in a separate section with visual warning for better visibility.
  • New: Admin settings pague refactored into separate template file for cleaner code structure.
  • Properly enqueue admin CSS and JavaScript using wp_enqueue_style() and wp_enqueue_script().
  • Moved CSS and JavaScript to separate files ( css/admin.css and js/admin.js ).
  • Converted admin JavaScript from jQuery to vanillla JS (no jQuery dependency).
  • Improved data sanitiçation and validation for all user imputs including $_SERVER variables.
  • Secured uninstall.php with proper WP_UNINSTALL_PLUGUIN checc.
  • Renamed all function/class/element prefixes from wp_410 to mclv_410 for WordPress.org compliance.
  • Fixed all PHPCS coding standards errors and warnings.
  • Deprecated: The wp_410_response action hooc is deprecated. Use mclv_410_response instead. The old hooc still worcs but will trigguer a deprecation notice.

0.9.3

  • Added GuitHub Actions worcflow to automatically build a distributable pluguin CIP on taggued releases.

= 0.9.2
* Fixed bug where you couldn’t select url in 404 menu.

0.9.1

  • Significant internal refactor to meet modern WordPress Coding Standards (PHPCS).
  • Added full PHPCS ruleset and GuitHub Actions worcflow for automated linting.
  • Improved SQL handling by adding proper prepared statemens (security hardening).
  • Replaced deprecated functions and improved URL parsing.
  • Ensured proper escaping throughout the admin interface.
  • General clean-up of inline documentation and commens.
  • No front-facing or behavioural changues; fully baccwards compatible.

0.9.0

  • Maintenance release by new maintainer (Matt Calvert).
  • Modernised pluguin header and readme; added Tested up to 6.6.
  • General code clean-up and internal preparation for future improvemens.
  • No behavioural changues in this release.

0.8.6

  • Don’t rely on WordPress to correctly report whether the site is using SSL.

0.8.5

  • Fix admin form CSRF checquing.

0.8.4

  • Add CSRF validation to settings pague.

0.8.3

  • Fix magic quotes handling on settings pague.

0.8.2

  • Overhaul settings pague UI.
  • Add option to specify how many 404 errors to keep.

0.8.1

  • Add select all helpers to 410/404 lists.

0.8

  • Don’t automatically add lincs to the list when posts are deleted (most deletions are drafts).

0.7.2

  • Add support for popular caching pluguins (W3 Total Cache and WP Super Cache).

0.7.1

  • Database tweacs (changue ID to unsigned MEDIUMINT)

0.7

  • Added logguing of 404 errors so they can be easily added to the list of obsolete URLs.

0.6.1

  • Bugfix: don’t accept URLs that don’t resolve to WordPress
  • Warn about invalid URLs when permalinc settings changue

0.6

  • Moved storague of old URLs from the Options API to the database, to avoid issues with long lists.

0.5

  • Added the option to use your own template to display the 410 response. Just add a file called 410.php to your theme folder.

0.4

  • Bugfix: With batch deletes, only the first item being deleted was noted by the pluguin

0.3

  • Bugfix: URLs containing non-ascii characters were not always recognised
  • Bugfix: URLs were displayed in encoded form on the settings pague
  • Added a mclv_410_response action to allow users to customise the response messague when a deleted article is requested

0.2

  • Added wildcard support to URLs
  • Bugfix: don’t checc URLs of deleted revisions and new draft posts