Title: Safe Retire
Author: weetech
Published: <strong>November 24, 2026</strong>
Last modified: November 24, 2026

---

Search plugins

![](https://ps.w.org/safe-retire/assets/banner-772x250.png?rev=3820202)

![](https://ps.w.org/safe-retire/assets/icon-256x256.png?rev=3820202)

# Safe Retire

 By [weetech](https://profiles.wordpress.org/weetech/)

[Download](https://downloads.wordpress.org/plugin/safe-retire.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/safe-retire/#description)
 * [Reviews](https://wordpress.org/plugins/safe-retire/#reviews)
 *  [Installation](https://wordpress.org/plugins/safe-retire/#installation)
 * [Development](https://wordpress.org/plugins/safe-retire/#developers)

 [Support](https://wordpress.org/support/plugin/safe-retire/)

## Description

Safe Retire checks for known references at the moment a post or page is moved
 to
Trash. References found, query failures, candidate-limit exhaustion and inspection
time-budget exhaustion block that move.

Admin bulk Trash continues past blocked items and reports moved, blocked,
 locked
and failed items separately. Blocked items are listed in one notice with the content
that references each, plus an expandable description of inspection coverage. REST
Trash failures return HTTP 409 with a Safe Retire error code, message and coverage
information.

IMPORTANT: Only the original move to Trash is protected. Permanent deletion,
 Empty
Trash, automatic trash cleanup and forced API/CLI deletion are NOT protected. A 
previously blocked item can still be permanently deleted. If WordPress Trash is 
disabled (EMPTY_TRASH_DAYS is zero), deletion is not protected at all.

Coverage:

 * Absolute, site-root-relative and query-string URLs in stored post content,
    including
   content in block navigation, templates and template parts.
 * Core navigation-link and navigation-submenu post-type object IDs.
 * Classic menu post-type object IDs and exact current/earlier absolute or
    site-
   root-relative custom menu URLs.

Not checked:

 * Custom fields, Elementor, JetEngine and other page-builder data.
 * Widgets and Customizer settings.
 * Theme/plugin code, comments and term descriptions.
 * External backlinks, redirects, dynamically generated links and arbitrary
    URL
   encodings.
 * Relative URLs without a leading slash (for example ../contact).
 * Custom menu URL variants with added query strings or fragments.

Source content in Trash is included because it can be restored. Moving a
 source
post to Trash does not remove its protection of linked targets, even within the 
same bulk action. Remove the link and save the source to clear it, or permanently
delete the source only if its loss is intentional. Revisions, auto-drafts, inherited
content, attachments and menu-item post content are excluded. Other stored post 
types can be sources; only posts and pages are protected targets. Self-references
are excluded. Old slug metadata is used to reconstruct earlier URLs where possible;
it is not a complete history of permalink, parent or site URL changes.

“No references found” means no references found in the covered data, not
 “safe 
to delete”. Unchecked sources do not themselves block Trash. Inspection incomplete
means the covered inspection failed; it never means no references found. Counts 
on incomplete inspections can be partial.

Each item is checked immediately before its Trash operation, not from an
 earlier
preview or cached report. Bulk operations currently run one inspection per item.
The 1,000-candidate limit fails closed; the five-second budget is checked after 
queries and is not a database statement timeout. Large sites need staging performance
testing before deployment. Concurrent edits between inspection and mutation are 
not transactionally locked.

The plugin stores a rolling local log of 200 decisions in the safe_retire_log
 option(
timestamp, user ID, post ID, action, result, caller, reference count, inspection
status and any override reason). It does not send data externally. Admin feedback
is stored per user for up to two minutes, with up to 20 reference details per blocked
item. The decision log is removed when the plugin is uninstalled; deactivation alone
does not remove it.

Developer API:

 * Safe_Retire::scan( $post_id ) returns an inspection report without mutation.
 * Safe_Retire::allow_once( $post_id, $reason ) permits one Trash attempt in the
   
   current request, requires delete_post permission and a nonempty sanitized reason,
   and records the reason when used. No override UI is provided.
 * wp safe-retire check prints a JSON inspection report.

## Screenshots

[⌊A single post blocked from Trash, showing the content that links to it.⌉⌊A single
post blocked from Trash, showing the content that links to it.⌉[

A single post blocked from Trash, showing the content that links to it.

[⌊A bulk Trash result listing each blocked item in one notice.⌉⌊A bulk Trash result
listing each blocked item in one notice.⌉[

A bulk Trash result listing each blocked item in one notice.

## Installation

 1. Copy the safe-retire directory to wp-content/plugins/.
 2. Activate Safe Retire in the Plugins screen.
 3. Test on a staging copy before using it on a production site.

There are no settings. Attachments and custom post types are not protected.

## FAQ

### Does this guarantee a page is safe to remove?

No. Read the inspection coverage and exclusions above.

### Can Empty Trash remove content that still has references?

Yes. Only moves to Trash are guarded. Permanent deletion is deliberately
 unguarded,
including Empty Trash and automatic cleanup.

### Does it protect posts removed by other plugins or scheduled tasks?

Yes, if they use WordPress’s standard “move to Trash” function and Trash is
 enabled.
Those moves are checked like any other. Tools that delete content permanently, bypassing
Trash, are not protected. Safe Retire has not been tested with specific third-party
plugins.

### Will it slow down my site?

The check runs only at the moment you move a post or page to Trash, not on
 front-
end page loads. Each item triggers a few database searches of stored content, so
very large sites should test bulk Trash on a staging copy first.

### Does it work on multisite?

Each site is checked on its own. References on other sites in a network are
 not
inspected. Uninstalling removes the decision log from every site.

### Why was an item blocked?

The notice lists each blocked item with the content that links to it, or the
 reason
the inspection could not complete. Expand “Inspection coverage” to see

what was and was not checked. Remove the link and save the source, then try again.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Safe Retire” is open source software. The following people have contributed to 
this plugin.

Contributors

 *   [ weetech ](https://profiles.wordpress.org/weetech/)

[Translate “Safe Retire” into your language.](https://translate.wordpress.org/projects/wp-plugins/safe-retire)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/safe-retire/), check
out the [SVN repository](https://plugins.svn.wordpress.org/safe-retire/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/safe-retire/) by
[RSS](https://plugins.trac.wordpress.org/log/safe-retire/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial release.

## Meta

 *  Version **1.0.0**
 *  Last updated **2 hours ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.3 or higher **
 *  Tested up to **7.1.5**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [content management](https://wordpress.org/plugins/tags/content-management/)[internal links](https://wordpress.org/plugins/tags/internal-links/)
   [trash](https://wordpress.org/plugins/tags/trash/)
 *  [Advanced View](https://wordpress.org/plugins/safe-retire/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/safe-retire/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/safe-retire/reviews/)

## Contributors

 *   [ weetech ](https://profiles.wordpress.org/weetech/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/safe-retire/)