• Resolved amaheer1

    (@amaheer1)


    Hi guys, I’m having problems with AMP plugin, it’s partially corrupted I believe on my website, trying to fix the problem is not an option for me as I’m not a developer.

    Every time I deactivate/delete then reinstall the plugin, it returns with all previous setup, so it looks like not completely deleted.

    How can I uninstall it completely and delete all hidden data? So I can reinstall it fresh..

    Appreciate your help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @amaheer1

    We are working on the issue to remove all data when the plugin is uninstalled, this will be released in the upcoming v2.2, you can follow this issue to know the progress.

    https://github.com/ampproject/amp-wp/issues/3210

    You can use the WP CLI command or SQL Queries to delete AMP plugins data.

    Disclaimer: Run the below commands and SQL query at your own risk.

    Note: Run them first in dev/pre-production environment to reduce the risk of losing the data.

    We will recommend deleting the data with WP CLI, Run the following CLI commands.

    WP CLI

    1. Remove AMP settings data:
    wp option delete amp-options

    2. Remove all amp_validated_url posts:
    wp post delete $(wp post list --post_type='amp_validated_url' --format=ids)

    3. Remove all amp_validation_error terms:
    wp term list amp_validation_error --field=term_id | xargs wp term delete amp_validation_error

    SQL Queries

    If you can access your site database using Cpanel or PHPmyadmin tool, you can delete AMP data using the following SQL queries

    Execute them in the sequence they are provided ( check your table prefix and use that instead of wp_)

    1. Remove AMP settings data:
    DELETE FROM wp_options WHERE option_name LIKE 'amp-options'

    2. Remove post meta ( if we use WP CLI it will be remove associated post meta )
    DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.post_type='amp_validated_url'

    3. Remove all amp_validated_url posts
    DELETE FROM wp_posts WHERE post_type = 'amp_validated_url'

    4. Remove term meta
    DELETE FROM wp_termmeta WHERE term_id IN ( SELECT term_id FROM wp_term_taxonomy WHERE taxonomy = 'amp_validation_error' )

    5. Remove term relations
    DELETE FROM wp_term_relationships WHERE term_taxonomy_id IN ( SELECT term_taxonomy_id FROM wp_term_taxonomy WHERE taxonomy = 'amp_validation_error' )

    6. Remove terms
    DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy = 'amp_validation_error' )

    7. Remove taxonomies
    DELETE FROM wp_term_taxonomy WHERE taxonomy = 'amp_validation_error'

    Hope this helps!

    Plugin Support Milind More

    (@milindmore22)

    @amaheer1 We hope our response is helpful, I’ll mark this as resolved Open a new support topic if you face further issues, also feel free to leave a plugin review, we would love to hear your feedback.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to delete plugin data, completely’ is closed to new replies.