Data Storage¶
Add-Meta-Tags uses the WordPress API to store its data.
Options¶
All Add-Meta-Tags settings are stored in a single array, which is stored as the add_meta_tags_opts
option. To programmatically retrieve the Add-Meta-Tags settings array, please use the following code:
$amt_stored_options = amt_get_options();
Custom Fields¶
Add-Meta-Tags uses the following internal Custom Fields to store data.
Post objects¶
The data of the following post related Custom Fields is stored in the wp_postmeta
table of the database.
_amt_description
- the content's custom description (thedescription
field is also read as a fallback for backwards compatibility)._amt_keywords
- the content's custom keywords (thekeywords
field is also read as a fallback for backwards compatibility)._amt_title
- the content's custom title._amt_news_keywords
- the content's custom news keywords._amt_full_metatags
- the content's full meta tag code._amt_image_url
- URL of an image that overrides all other content images (see Notes below)._amt_content_locale
- contains a content locale that overrides the global locale setting._amt_express_review
- contains special notation of review related information._amt_referenced_list
- list of URLs of items referenced in the post.
Term objects¶
The data of the following term related Custom Fields is stored in the wp_termmeta
table of the database.
_amt_term_full_metatags
- contents of the full meta tags box._amt_term_image_url
- custom image URL field (see Notes below).
User objects¶
The data of the following user related Custom Fields is stored in the wp_usermeta
table of the database.
_amt_user_full_metatags
- contents of the full meta tags box._amt_user_image_url
- custom image URL field (see Notes below).
Notes¶
The fields that are about the image URL may contain:
- An integer (attachment ID)
- A URL
- The special notation:
URL,WIDTHxHEIGHT
Contact Methods¶
The contact methods are Custom Fields of user objects.
The data of the following user related Custom Fields is stored in the wp_usermeta
table of the database.
The extra contact methods added by Add-Meta-Tags are:
amt_facebook_author_profile_url
as Facebook author profile URL (AMT)amt_googleplus_author_profile_url
as Google+ author profile URL (AMT)amt_twitter_author_username
as Twitter author username (AMT)
The following contact methods were also used in older releases:
amt_facebook_publisher_profile_url
as Facebook publisher profile URL (AMT)amt_googleplus_publisher_profile_url
as Google+ publisher page URL (AMT)amt_twitter_publisher_username
as Twitter publisher username (AMT)
Data clean up after uninstall¶
Add-Meta-Tags contains an uninstall script which cleans the plugin settings from the database when the plugin is deleted via the WordPress administration interface. This clean up process does not take place if the plugin is remove by other means.
The extra data, which might have been entered by the user in the Metadata box in the post editing screen and has been stored in custom fields, is not cleaned automatically by the uninstall script. This is by design so as to prevent users from losing all their custom data. Please check the Add-Meta-Tags command-line interface's clean
command.
Migrate data by renaming the custom fields¶
As mentioned above, Add-Meta-Tags stores its data in WordPress Custom Fields. This is common practice for many WordPress plugins. So, migrating this data between plugins, that make use of the Custom Fields, requires the renaming of the field names.
Below, there is an example about how to rename the custom description field (_amt_description
) of Add-Meta-Tags to the equivalent field (_other_description
) of another plugin and thus migrate the data.
Please note that the following example is provided for informational purposes and for advanced users only who have knowledge about how to issue SQL statements directly at the MySQL shell. If it seems too advanced for you, then please consult a technical expert.
Also, please, always keep a backup of your database before making any changes to it from the MySQL shell.
UPDATE wp_postmeta SET meta_key='_other_description' WHERE meta_key='_amt_description';
The above SQL statement renames the _amt_description
field of the wp_postmeta
table to _other_description
.