Documentation · Operations and Maintenance
Uninstall and Data Cleanup
This document describes what happens when the ADP Car Market Hub plugin is deactivated or uninstalled, what data is removed, what is retained, and how to control cleanup behavior. It also covers risks and recovery options.
When to use this document
Read this document before uninstalling the plugin from a production site. It is especially important if you want to preserve imported vehicle data, leads, or analytics after removing the plugin, or if you need to understand what will be deleted automatically.
Overview
The plugin's uninstall routine is executed when an administrator deletes the plugin through WordPress Admin → Plugins → Delete. The routine is defined in uninstall.php and runs in the context of the WordPress admin.
Simply deactivating the plugin does not delete any data. Data removal only occurs when the plugin is deleted (not just deactivated).
The uninstall routine distinguishes between:
- Items that are always removed — regardless of any setting
- Items that are conditionally removed — only if the Delete data on uninstall option is enabled
- Items that are never removed by the uninstall routine
What is always removed on uninstall
The following are always deleted when the plugin is removed, regardless of the Delete data on uninstall setting:
| Item | Details |
|---|---|
| All plugin options | All wp_options rows with as24ci_ prefixed keys, including API credentials, import settings, schedule configuration, design settings, lead form settings, and analytics settings |
Database table: {prefix}as24ci_analytics | Dropped unconditionally because it holds visitor tracking data and must not persist after the plugin is removed |
Database table: {prefix}as24_vehicles | Dropped unconditionally (vehicle field data used for display and search) |
Database table: {prefix}as24ci_search_agents | Dropped unconditionally because it holds personal data (subscriber name, email, search preferences) |
Database table: {prefix}as24ci_content_studio_jobs | Dropped unconditionally (Content Studio AI content-generation job records) |
Database table: {prefix}as24ci_content_studio_assets | Dropped unconditionally (Content Studio generated marketing assets: captions, hashtags, alt text, image references) |
| Schema version options | as24ci_vehicles_db_version, as24ci_search_agent_db_version and as24ci_content_studio_db_version are deleted alongside their tables |
| WP-Cron events | as24ci_scheduled_import and as24ci_daily_cleanup are unscheduled |
| Transients | as24ci_access_token, as24ci_cron_import_running, as24ci_image_queue_running are deleted |
These deletions cannot be undone. If you need to retain analytics data or vehicle field data, export it from the database before uninstalling.
What is conditionally removed on uninstall
The following items are only deleted if the Delete data on uninstall option (as24ci_delete_data_on_uninstall) is set to 1 (enabled):
| Item | Details |
|---|---|
Vehicle posts (CPT: as24ci_car) | All posts of the custom post type as24ci_car, in any status (published, draft, trash), are permanently deleted |
| Imported vehicle images | Attachments tracked in the _as24ci_image_ids post meta for each vehicle post are permanently deleted from the WordPress media library |
| Featured images | If the vehicle post's featured image is an imported attachment, it is also deleted |
Lead posts (CPT: as24ci_lead) | All posts of the custom post type as24ci_lead are permanently deleted |
| Activation-created pages | The archive page, compare page and favorites page created by the plugin on activation (IDs stored in as24ci_page_archive_id, as24ci_page_compare_id and as24ci_page_favorites_id) are permanently deleted |
If this option is disabled (the default), all vehicle posts, images, and leads remain in the WordPress database and media library after the plugin is deleted. They will not be accessible through the plugin's admin UI, but the underlying WordPress data is preserved.
What is never removed
The following items are not deleted by the uninstall routine, regardless of settings:
| Item | Details |
|---|---|
| Manually uploaded gallery images | Attachments tracked in _as24ci_manual_image_ids (images added manually through the WordPress media library, not imported from AutoScout24) are never deleted |
| WordPress user accounts | Any users who were granted the manage_as24_imports capability retain that capability entry in the WordPress user meta |
| Log files | The {uploads}/as24ci-logs/ directory and its contents are not deleted by the uninstall routine. Delete them manually via SFTP or the hosting file manager if needed |
| Cached data left in object cache | External object caches (such as Redis or Memcached) may retain plugin-related transient data until they expire naturally |
How to control cleanup behavior
The Delete data on uninstall option is found in the plugin's Settings tab.
- Open ADP Car Market Hub → Settings.
- Find the Delete data on uninstall toggle or checkbox.
- Enable it if you want all imported vehicle posts, images, leads, and activation pages to be removed when the plugin is deleted.
- Leave it disabled (the default) if you want to preserve the imported content after the plugin is removed.
Recommendation: For a test or staging site where imported data can be discarded, enable this option before uninstalling. For a production site where the import history may be reused or audited, leave it disabled and manage content removal manually.
Multisite behavior
On WordPress multisite installations, the uninstall routine runs once per site in the network. For each site:
- If Delete data on uninstall is enabled, vehicle posts, images, leads, and activation pages are deleted for that site.
- The custom database tables (
as24ci_analytics,as24_vehicles,as24ci_search_agents,as24ci_content_studio_jobs,as24ci_content_studio_assets) are dropped for that site (always). - All plugin options for that site are deleted (always).
The multisite loop uses switch_to_blog() / restore_current_blog() to process each site independently.
Step-by-step: safe production uninstall
- Take a full backup of the database and uploads directory before proceeding. See Backup and Restore.
- If you want to preserve vehicle data, leave Delete data on uninstall disabled (the default). If you want a clean removal, enable it now.
- If you need to retain analytics data for reporting, export the
{prefix}as24ci_analyticstable from the database using phpMyAdmin, the WordPress CLI, or your hosting database tool before proceeding. This table is always dropped on uninstall. - Navigate to WordPress Admin → Plugins.
- Deactivate the plugin first, then click Delete.
- Confirm the deletion prompt. The uninstall routine will run automatically.
- Verify the outcome: - Navigate to WordPress Admin → Tools → Database (or a database tool) and confirm that the custom tables are gone. - If Delete data on uninstall was enabled, verify that the vehicle archive page no longer exists. - If data was retained, confirm that the vehicle posts are still present in WordPress Admin → Posts or by visiting the archive URL directly.
- Delete the log directory manually via SFTP if it is no longer needed:
{wp-content/uploads}/as24ci-logs/.
Operational notes and risks
- The analytics table (
{prefix}as24ci_analytics) is always dropped on uninstall without warning, even if Delete data on uninstall is disabled. If you have analytics data you want to keep, export it before deleting the plugin. - Similarly, the vehicles table (
{prefix}as24_vehicles), search agents table ({prefix}as24ci_search_agents) and the two Content Studio tables ({prefix}as24ci_content_studio_jobs,{prefix}as24ci_content_studio_assets) are always dropped. - Imported images deleted by the uninstall routine are removed permanently from the server filesystem. They cannot be recovered from the WordPress media library.
- If the
get_sites()function is not available on a multisite installation, the uninstall routine falls back to single-site behavior and processes only the current site. - The option keys cleaned up on uninstall are derived from the
Optionsclass at runtime, so the list is always current with the installed plugin version. A fallback hard-coded list is used if theOptionsclass cannot be loaded. - Deactivating the plugin without deleting it does not run the uninstall routine. No data is removed on deactivation. The plugin can be reactivated at any time and will resume normal operation.
Troubleshooting
| Symptom | Likely cause | Check |
|---|---|---|
| Vehicle posts still present after uninstall | Delete data on uninstall was disabled (the default) | Expected behavior; delete posts manually or re-enable the option and delete again |
| Analytics data missing after uninstall | Analytics table is always dropped on uninstall | Export the table before deleting the plugin |
| Log files still present after uninstall | Log files are not removed by the uninstall routine | Delete the as24ci-logs/ directory manually via SFTP |
| Manually uploaded images deleted | Check that they were added via _as24ci_manual_image_ids, not imported via _as24ci_image_ids | If accidentally deleted, restore from a backup |
| Plugin options still present after uninstall | Uninstall routine did not complete (PHP error during deletion) | Check the PHP error log; re-trigger by reinstalling and deleting again |
| Custom tables still present in database | Uninstall routine encountered a database permission error | Run DROP TABLE IF EXISTS {prefix}as24ci_analytics manually |