Problem Description #
You want the plugin to remove old slugs automatically on a schedule (e.g., daily, weekly) instead of manually clicking “Remove old slugs.”
Common symptoms / messages:
- Users ask “How can I delete old slugs automatically?” or request scheduled cleanup options in the forum. WordPress.org
Cause:
The free plugin UI may not expose scheduled automatic cleanup; the Pro version or a small customization may be required to schedule tasks. Many users request scheduling as a feature request.
Solution – step-by-step #
- Check plugin settings and Pro features
- Review WPFactory docs / plugin settings for an automatic cleanup option. The Pro flavor of Slugs Manager may include scheduled cleanup (see WPFactory Pro features). If Pro supports it, enable the schedule and configure the interval. WPFactory+1
- If feature not available, schedule via WP-Cron + custom snippet (developer)
Add a scheduled event that calls the plugin’s cleanup routine (only if the plugin exposes a callable function). Example (developer sample):
// schedule event on plugin activation
if ( ! wp_next_scheduled( ‘slugs_manager_cleanup_hourly’ ) ) {
wp_schedule_event( time(), ‘daily’, ‘slugs_manager_cleanup_hourly’ );
}
add_action( ‘slugs_manager_cleanup_hourly’, ‘slugs_manager_run_cleanup’ );
function slugs_manager_run_cleanup() {
if ( function_exists( ‘slugs_manager_remove_old_slugs’ ) ) {
slugs_manager_remove_old_slugs();
}
}
- Important: Use this only if the plugin documents/exports the cleanup function (slugs_manager_remove_old_slugs is an illustrative name — verify actual function). Test on staging.
- Use server cron + WP-CLI as robust alternative
- Create a small script or wp cron event run –due-now call on a server cron that runs the plugin’s cleanup function via WP-CLI or a custom script. Server cron is more reliable than WP-Cron on low-traffic sites.
- Test thoroughly on staging
- Always test scheduled deletion in staging to ensure it only removes intended slugs.
- If you need help, request a documented API from vendor
- If the plugin doesn’t expose an internal function for cleanup, ask WPFactory to provide a programmatic hook or WP-CLI command in a future release.
- If the plugin doesn’t expose an internal function for cleanup, ask WPFactory to provide a programmatic hook or WP-CLI command in a future release.
Prerequisites #
- Admin + developer access for adding code or setting server cron.
- Staging environment for safe testing.
Additional Notes / Prevention #
- Keep logs of cleanup runs and consider backing up DB before scheduled runs.
For busy sites, schedule during low traffic periods.
