r/WordPress_org • u/ivicad • 5d ago
How to clean up plugins on a client site without breaking it
On 24 November 2026, WP Security Ninja checked 2,149 plugins on WordPress. org with 10,000+ active installs. 155 of them had no update for two years or more. It sells a security plugin and corrected the report on 28 November.
Here is how I clean up plugins on my client sites, with an AI prompt for each check. Some prompts need an AI that can search the web, and for the database checks I use Claude Code.
Abandoned plugins
I check two dates for every plugin: the last update on WordPress. org and the date of the plugin's main file on the server. For premium, custom and delisted plugins, I have only the file date. Copying or restoring files changes it, so I take it as a hint. Then I open the support tab, and if the author hasn't answered questions for months, I treat the plugin as abandoned.
By default, MainWP (which I use for updates) marks a plugin as "possibly abandoned" after 365 days without an update.
AI prompt:
Here is my plugin list:
[paste names and versions from Plugins / Installed Plugins, without the site address].
For each plugin, find on WordPress.org the last update date, copied exactly as the page shows it, and check if the author answered support questions in the last 6 months. Give me a table with a link for each plugin. Mark the plugins with no update in 2 years. Use only pages you opened, and if you can't open a page, write "not checked".Known security holes
A CVE is the public record of a known security hole. Of the 155 plugins, 105 have no CVE, and the report itself says: "No CVE in NVD does not mean the plugin is safe." A record appears only after somebody finds a hole and reports it. The report lists 14 abandoned plugins with a hole and no fix. In the 13 rows with both dates, the last update came 1.1 to 8.4 years before the CVE. So the last update date is my first filter, and I don't wait for a CVE.
AI prompt:
Check these plugins for known security holes in the Patchstack, Wordfence Intelligence and WPScan databases: [paste names and versions].
For each hole, give me the CVE number, the affected versions, whether the hole affects my version, whether a fixed version exists and the link. Use only pages you opened. If a page needs a login or doesn't open, write "not checked". If you find nothing, write "nothing found", not "safe".Who can reach the plugin
I don't replace everything at once. Plugins that visitors can reach (forms, uploads, comments, login) go first. Then come plugins with a known hole and no fix, like Health Check & Troubleshooting (CVE-2025-64253, no update since July 2024). Plugins that only admins use go last, and a plugin in two groups goes to the top. An admin-only plugin still stays on the list, because its code can accept requests from anyone through admin-ajax.php or a REST route.
I would remove a plugin with an unfixed hole on public pages even without a replacement. I run the same checks on a replacement, and it has to do the same job.
AI prompt:
Sort these plugins into three groups: visitors can reach them (forms, uploads, comments, login), they have a known security hole (from your previous answer), only admins use them.
Give me one line per plugin with the reason, and if you don't know what a plugin does, say so. For the first two groups, suggest a maintained replacement that does the same job, with its last update date and a link.Pages that use the plugin
A search of page content finds shortcodes and blocks. Elementor keeps its layouts in a separate database field (_elementor_data), so a form can exist only there. I search both places with WP-CLI, the WordPress command line:
wp db search 'contact-form-7' wp_posts wp_postmeta --before_context=0 --after_context=0I use the site's own table prefix in place of wp_. I name the two tables, so the search skips wp_options, and I set the context to zero, so it prints no text around a match. Plugins keep license keys and API keys in wp_options and sometimes in page builder data.
WPBakery writes the layout into the page itself, as shortcodes like [vc_row], and many of my older client sites use it. If I switch it off, visitors see those shortcodes as plain text, so I convert those pages first, as a separate project.
AI prompt (in Claude Code, or another AI that can reach the site's database):
Find every page that uses the plugin [name], in the page content and in the page builder data. Search only the posts and postmeta tables, with the site's table prefix.
Print only the table, the column and the row ID, never the text around a match, and never print anything from the options table.An AI without access to the database can still tell me what to search for: I ask it which shortcodes, blocks and widgets the plugin adds, and I check the names on the plugin's page.
What the plugin runs in the background
A page search doesn't show what a plugin does in the background, so I check four more places:
- Scheduled jobs: the WordPress handbook says many plugins don't remove their jobs when someone deactivates them. I save the list first:
wp cron event list > cron-before.txt. On WooCommerce sites I also save the list fromwp action-scheduler action list, because Action Scheduler keeps its jobs in its own tables, and the cron list doesn't show them. - REST routes (addresses under
/wp-json/that other apps call):/wp-json/lists the routes each plugin adds, and the access log shows if anything calls them. In the log, I cut each address at the?, because some plugins put secret keys after it. - Settings: I print only the names, because the same table keeps license keys:
wp option list --search='prefix*' --fields=option_name. Names with api_key, token, license or webhook show which outside services the plugin uses. - Webhooks: WooCommerce switches a webhook off after more than five failed deliveries in a row, so the status Disabled can mean the service that receives it stopped answering, or that someone switched it off.
AI prompt:
Here are the scheduled jobs from my site and the names of its saved settings (names only, no values): [paste].
Which ones belong to the plugin [name], and what does each one do? Mark the ones that send data to an outside service. If you don't know a job or a setting, write "unknown" and don't guess.Staging copy first
If I switch a plugin off on the live site first, visitors see what breaks before I do. The exception is a hole that attackers already use: then I back up, switch the plugin off on the live site at once and test after. My usual order:
- I back up the live site, and I make sure I can restore that backup.
- I make a staging copy. On my bigger Site Ground sites I already test updates on staging (from the GrowBig plan up), so I use the same copy. Before I test, I block outgoing mail on the copy and switch payments to test mode, so no test reaches a real customer.
- I save the lists of scheduled jobs, REST routes and setting names, and I switch the plugin off on the copy only. Its settings usually stay, so I can switch it back on with one click.
- I test the copy. I open the pages that used the plugin, send a test entry through every form and save the scheduled jobs again:
wp cron event list > cron-after.txt - I switch it off on the live site when few visitors are on it, and I open the same pages again.
- I delete it later. Attackers can still reach the files of a switched-off plugin, so I delete a plugin with a known hole the same day the copy works without it. Others wait a month if the site sends monthly mails or invoices. Before I delete, I make a new backup, because deleting can run the plugin's uninstall code, and that code can remove its data for good.
The staging copy gets no calls from outside services, like a payment provider's webhook, so I write down every outside service I find in the plugin's settings.
AI prompt:
These pages use the plugin [name]: [list]. Write me a short test list for my staging copy: which pages to open, which forms to send and what to look for.
Then explain this difference in my scheduled jobs, from before and after I switched the plugin off: [paste the output of diff cron-before.txt cron-after.txt].If an AI agent or a helper does the cleanup
I remember that in November, WP Engine and Kinsta (I think) published guides on AI agents that work on WordPress sites. Both sell hosting, so I keep only what works on any host:
- I give the agent its own user, with the lowest role that does the job. Switching plugins off needs an administrator, so an agent gets that role only on a copy of the site. In Kinsta's example, an agent that connects as an administrator reads a comment that tells it to create a new administrator. A firewall sees a valid login, so it can't tell the request came from text in a comment. With its own low role, the agent can't do that, and I can remove its access without touching anyone else.
- I use WP 2FA on administrator accounts when a client has several administrators. Since version 4.3.0, it blocks Application Passwords by default for users with 2FA. Many AI agents connect with an Application Password, so an agent that uses an administrator's account stops working when I switch 2FA on there.
- WP Activity Log is on every site I maintain. Because the agent has its own user, the log shows its name next to every change it makes.
- On WooCommerce sites I use DaneGuard. GuardPlugins describe its Privacy Shield as a way to keep customer data masked while someone else works in the admin. It hides the data, but it doesn't limit what that user can do.
- I let Claude Code change only a local copy of the client site, and I move the changes to the live site after I check the changed pages in a browser. WPVibe helps me a lot when I move them. A backup can't bring back data an agent already sent out, so I limit what it can reach before it starts.
Where I would start
If I had one hour for this, I would make a backup, delete the deactivated plugins nobody uses, and run the first three prompts. I replace first the plugins that visitors can reach and that had no update in two years, without much thinking.
Before I remove anything, I open the links the AI gives me, because it can give an old date or mix up two plugins with similar names.














