For the simple sites where AMP has been deprecated, they don't get this opportunity to do cleanup. We should write a script that walks the blog network and does cleanup.
Rationale: pdKhl6-na-p2
Checklist
[ ] Script calls amp_deactivate() to clean up rewrite rules and cron job options
[ ] Script removes the amp_enabled option, which will be there if the user has explicitly removed
[ ] Script doesn't remove other AMP options
amp-options and amp_customizer are added by the AMP plugin, but they're also referenced by Jetpack code. If JP is syncing these options between the wpcom cloud site and the JP host site then we don't want to delete them and break the JP site.
[ ] Ensure we only clean up sites where AMP has been deprecated (i.e. marketing landing pages shouldn't be cleaned)
[ ] Get a confidence check from the Systems Team before we start running the script in production
Details
When the AMP plugin is removed from a standalone WordPress site it uses the
amp_deactivate()
function to tidy up after itself when the plugin gets deactivated.For the simple sites where AMP has been deprecated, they don't get this opportunity to do cleanup. We should write a script that walks the blog network and does cleanup.
Rationale: pdKhl6-na-p2
Checklist
amp_deactivate()
to clean up rewrite rules and cron job optionsamp_enabled
option, which will be there if the user has explicitly removedamp-options
andamp_customizer
are added by the AMP plugin, but they're also referenced by Jetpack code. If JP is syncing these options between the wpcom cloud site and the JP host site then we don't want to delete them and break the JP site.