Project

General

Profile

Add-Meta-Tags Command Line Interface

This page contains detailed information about the command line interface of the Add-Meta-Tags plugin. This interface is made available through the excellent wp-cli project.

NOTICE: This page is still a draft. Please check back often for updates.

The amt command

Add-Meta-Tags implements the amt command of wp-cli. In order to get help about the usage and the available subcommands invoke the following command in your terminal:

~]$ wp help amt

NAME

  wp amt

DESCRIPTION

  Implements the Add-Meta-Tags command line interface.

SYNOPSIS

  wp amt <command>

SUBCOMMANDS

  clean        Delete settings, data and transient cache.
  export       Export settings and data.
  import       Import settings and data.
  status       Prints a status message about Add-Meta-Tags installation. (not implemented)
  upgrade      Upgrades the settings.

Getting help for subcommands

Get help about the available subcommands by invoking the following command:

wp help amt <subcommand>

The status subcommand

This subcommand has not been implemented yet.

The upgrade subcommand

This subcommand can be used to upgrade the settings of the plugin to the latest version. This affects only the seetings that are stored in the database. This command has nothing to do with plugin updates, but is only useful to manually upgrade the plugin's settings, after a plugin update.

For normal use, you will never need to use this subcommand, as settings upgrades take place automatically.

The general usage is:

wp amt upgrade [--network-wide]

By adding the --network-wide switch the Add-Meta-Tags settings of all the blogs in the network are upgraded.

The export subcommand

The export subcommand can be used to export the plugin's settings, post custom fields (for instance custom title, custom description, custom keywords, etc) or Add-Meta-Tags related user contact info fields (fields that are marked with AMT in the user profile page).

Data is exported in json format and printed to standard output.

The general usage is:

wp amt export settings|postdata|userdata|termdata

You can save the data in a file with:

wp amt export settings > amt_settings.json

You can compress the data before storing to a file with:

wp amt export postdata | gzip -9 > amt_postdata.json.gz

The import subcommand

The import subcommand can be used to import the plugin's settings, post custom fields (for instance custom title, custom description, custom keywords, etc) or Add-Meta-Tags related user contact info fields (fields that are marked with AMT in the user profile page).

Data must be in json format and is read from the standard input.

The general usage is:

wp amt import settings|postdata|userdata

You can import the data from a file with:

wp amt import settings < amt_settings.json

You can import previously compressed data with:

cat amt_postdata.json.gz | gzip -d > wp amt import postdata
# or with
zcat amt_postdata.json.gz > wp amt import postdata

The clean subcommand

The clean subcommand can be used to delete the plugin's settings, post custom field data (for instance custom title, custom description, custom keywords, etc), Add-Meta-Tags related user contact info field data (fields that are marked with AMT in the user profile page), and transient metadata cache.

The general usage is:

wp amt clean all|settings|postdata|userdata|cache

You will be prompted to confirm the deletion. Please note that deletions, once done, are final and cannot be undone.

You can clean all the data that has been stored by Add-Meta-Tags with:

wp amt clean all

This command should be used with caution.

Data integrity checks during imports

There are some data integrity checks that are performed while data is imported. These are just general checks which basically prevent you from importing user data in the post's meta table etc. The responsibility for data imports is always the user's. Please make sure you always import the correct data.