Published on
Dec 26, 2024
Updated on
Dec 30, 2024
Share

Manage HTTP 410 statuses with WPMasterToolKit's 410 Manager Module

Introduction

Deleting obsolete pages or articles on a website can have significant impacts on user experience and SEO. When a resource is permanently deleted, HTTP status 410 ("Gone") is the recommended way of indicating that this deletion is intentional and permanent. However, manually managing these statuses for multiple URLs can be tedious. To meet this need, we have created the 410 Manager from WPMasterToolKit. This module makes it easy to manage 410 statuses and improve the management of your deleted URLs.

Discover the module : Add essential short codes

Which plug-in can the 410 Manager module replace?

This module can replace several plugins dedicated to HTTP error handling, such as Ultimate 410 Gone Status Code or other extensions specialized in managing deleted URLs. With WPMasterToolKit, you centralize this functionality without adding another plugin to your list.

Main features of the 410 Manager module

  1. Simple management of deleted URLs : Add the URLs you wish to mark with an HTTP 410 status directly from the dashboard.
  2. Exclude URLs from XML sitemaps : Prevent search engines from crawling deleted URLs by automatically excluding them from sitemaps generated by WordPress, Yoast SEO or Rank Math.
  3. Exclude URLs from RSS feeds : URLs marked as 410 can also be excluded from your site's RSS feeds to avoid any indexing or communication problems with RSS readers.
  4. Support for Apache and NGINX servers :
    • Automatic generation of file rules .htaccess
    • Generate code to inject into your nginx.confto find your code in the Nginx Code Snippets

How to use the 410 Manager module

Using the module is simple and intuitive. Here are the steps to follow:

  1. Module activation : Activate the "410 Manager" module from the WPMasterToolKit dashboard.
  2. Adding URLs : Go to the "410 Manager" sub-menu. In the text field, enter the URLs you wish to mark as deleted (one URL per line).
  3. Additional options :
    • Exclude XML sitemaps : Enable this option to automatically remove URLs from sitemaps generated by WordPress, Yoast SEO or Rank Math.
    • Exclude RSS feeds : Check this option to prevent deleted URLs from being included in your site's RSS feeds.
  4. Registration: Once you've configured your settings, save them. Changes will be applied immediately.
HTTP 410 code management interface for WordPress.

Technical choices behind the module

The module 410 Manager stands out for its flexibility and compatibility with different server environments:

  1. Conditional application via PHP or :
    • By default, the module applies 410 rules at server level (Apache or NGINX) to reduce the load on the PHP side. However, it is possible to force the use of PHP via the filter wpmastertoolkit/410_manager/use_php.
  2. Compatibility with SEO extensions :
    • The module uses WordPress' native filters, Yoast SEO (wpseo_exclude_from_sitemap_by_post_ids) and Rank Math (rank_math/sitemap/entry) to ensure clean exclusion from sitemaps.
  3. Performance optimization :
    • Rules for Apache and NGINX are dynamically generated to minimize PHP calls during request processing.
  4. Safety : Data entered into the module (such as URLs) is systematically cleaned and validated to avoid any injections or malfunctions.

Customization via hooks and filters

The module offers several hooks to customize its behavior according to your needs:

  1. wpmastertoolkit/410_manager/use_php : Use this filter to force or disable the use of PHP to manage 410 statuses.
  2. wpmastertoolkit_nginx_code_snippets : Add or modify automatically generated NGINX rules.
  3. Third-party filters, use for sitemaps :
    • wp_sitemaps_posts_query_args for native WordPress.
    • wpseo_exclude_from_sitemap_by_post_ids for Yoast SEO.
    • rank_math/sitemap/entry and rank_math/sitemap/enable_caching for Rank Math.

How to switch to redirection via PHP

By default, the 410 Manager favors the use of server rules (Apache or NGINX) to apply HTTP 410 statuses. This approach optimizes performance by eliminating the need to process requests via PHP. However, in some cases (for example, if you can't modify the .htaccess or nginx.conf), you can force the module to use PHP to handle redirects to a 410 status.

Here's how to enable redirection via PHP :

Step 1: Add a filter to your custom theme or plugin

WordPress allows you to modify the module's behavior using the following filter:

add_filter( 'wpmastertoolkit/410_manager/use_php', '__return_true' );

Add this code to the functions.php of your active theme or in a custom plugin. This filter forces the 410 Manager ignore server rules and manage 410 statuses directly via PHP.

Step 2: Check operation

Once the filter has been added, the module will use PHP to parse each request and return an HTTP 410 status if the URL matches an entry in the list of deleted URLs. To check that this works :

  1. Go to one of the URLs marked as deleted in the 410 Manager.
  2. You should see a page with a generic "Page Not Found" message and an HTTP 410 status (you can check this with your browser's developer tools or an online tool like HTTP Status Checker).

Step 3: Disable server rules (optional)

If you are switching to redirection via PHP, it may be a good idea to disable the rules added to the .htaccess or nginx.conf. This will avoid conflicts or unexpected behavior. To do this, disable the module, then re-enable it after configuring PHP usage. This will reset any changes made to server files.

Points to consider

  1. Performance: Using PHP to manage 410 statuses may result in a slight increase in server load, as each request will be analyzed by WordPress. We recommend that you use server rules whenever possible, especially on high-traffic sites.
  2. Consistency of configurations : Be sure to test the impact of this modification on your site, especially if other plugins or caching tools are used, as these could affect the operation of redirects via PHP.

In short, although 410 status management via PHP is simple to activate and effective in certain contexts, it remains an alternative solution that can be useful when you can't access or modify server configurations.

Pro
from
2.50$
/Month
14
Days
Money-back guarantee
risk-free at 100 %!

Conclusion

The module 410 Manager from WPMasterToolKit is a robust and efficient solution for managing deleted URLs on your WordPress site. By integrating this functionality directly into an all-in-one plugin, you simplify your workflow while improving your site's performance and SEO. Whether you're a webmaster, developer or site owner, this module adapts to your needs and guarantees optimal management of HTTP 410 statuses.

Category
Contents & Media
Version
≤ 2.0.0
Type
Pro
More than 18 reviews
+1000
Installations
104
Modules
Pro
from
30.00$
/Year