Tidy up old code snippets in WPCode or Code Snippets
Go through the snippets added over the years, learn what each one does, switch off the ones you don't need and move the rest of the clutter to the trash.
- Difficulty
- Intermediate
- Time
- about 15 min
- Works with
- WPCode, Code Snippets
List the code snippets on my site in [WPCode or Code Snippets]: type, where each runs, whether it is on and who added it. Read each one and explain in one line what it does and whether it still seems needed, for example if it refers to a plugin I no longer have. Switch off the ones I mark, and after [days, e.g. a week] of no complaints, move them to the trash.
Already connected?
If SAR is already in your AI app, this is enough:
Explain each code snippet in one line, switch off the ones I mark, and trash them later.
What happens
- The AI app lists the snippets: type, where they run, whether they are on and which SAR wrote.
- It reads each snippet's code and explains it in plain words.
- Switching a snippet off is always allowed, since it stops code from running, and can be undone.
- Moving a snippet to the trash waits for your approval in SAR, and it can be restored from there.
Approvals involved
Worked out from the tools this recipe uses.
wordpress_list_snippetsList code snippetsNonewordpress_get_snippetGet a code snippetNonewordpress_deactivate_snippetSwitch a code snippet offNonewordpress_trash_snippetMove a code snippet to the trashApproval
What you get
Only the snippets you understand and need are left running, and the old ones are out of the way without being lost.
Related recipes
- Security & backups · about 15 minCode snippets you don't recognise, read and switched offList the snippets in WPCode or Code Snippets, have the code of any you don't know explained in plain words, and switch off the ones that look wrong.
- Design & builders · about 20 minFix a page that scrolls sideways on mobile with a small CSS snippetFind the element that makes a page wider than a phone screen and fix it with a CSS snippet in WPCode or Code Snippets, switched on with your password.
- Maintenance · about 10 minRun a weekly check-up of your WordPress siteOnce a week, ask for one short list: what is wrong on the site, which updates are waiting, which tasks are overdue and how fast the home page loads.
Try it on your own site
Install the plugin, add SAR to your AI app and paste the prompt. Free to start.