---
title: SEOPress &amp; WP-CLI
url: "https://www.seopress.org/support/guides/seopress-wp-cli/"
lang: en-US
updated: 2026-03-31
---

# SEOPress &amp; WP-CLI

## Exporting settings to a JSON file

```
wp seopress settings export
```

**Examples**

- Exports all SEOPress global settings to the wp-content/uploads/seopress directory. `wp seopress settings export --destination='/home/example/public_html/wp-content/uploads/seopress'`

**Parameters**

| Argument | Description |
| --- | --- |
| `[--destination=<value>]` | The path to the destination folder. Default: wp-content/uploads directory. |

## Import settings from a JSON file

```
wp seopress settings import
```

**Examples**

- Imports all SEOPress global settings from the wp-content/uploads/seopress directory. `wp seopress settings import --from='/home/example/public_html/wp-content/uploads/seopress'`

**Parameters**

| Argument | Description |
| --- | --- |
| `[--from=<value>]` | The path of the source folder. Default: wp-content/uploads directory. |

## CLI for SEO metadata

These commands are available with WordPress out of the box. More info on [official website](https://developer.wordpress.org/cli/commands/post/meta/).

### Get any SEO metadata

Read [this guide to find the desired post meta key](https://www.seopress.org/support/guides/list-of-all-post-metas-generated-by-seopress/).

```
wp post meta get 123 meta_name
```

**Examples**

- Get the SEO title for post ID equals to 123: `wp post meta get 123 _seopress_titles_title`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<post_id>` | The post ID. |
| `<post_meta_name>` | The post meta key. |

### Update any SEO metadata

```
wp post meta update 123 meta_name meta_value
```

**Examples**

- Update the SEO title for post ID equals to 123 with this value “my super SEO title”: `wp post meta update 123 _seopress_titles_title "my super SEO title"`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<post_id>` | The post ID. |
| `<post_meta_name>` | The post meta key. |
| `<post_meta_value>` | The post meta value. |

### Delete any SEO metadata

```
wp post meta delete 123 meta_name
```

**Examples**

- Delete the SEO title for post ID equals to 123: `wp post meta delete 123 _seopress_titles_title`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<post_id>` | The post ID. |
| `<post_meta_name>` | The post meta key. |

### Get / update / delete term SEO metadata

The commands are identical to those listed below with one exception, `post` becomes `term`. More info [here](https://developer.wordpress.org/cli/commands/term/meta/).

## Generate SEO metadata (title / meta description) with AI and CLI

 

```
wp seopress ai metadata --id=1
```

**Examples**

- Generate meta description for a list of post IDs in French language `wp seopress ai metadata --id=1,2,3,4,5 --meta=desc --language=fr_FR`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<id>` | List of Post ID separated by comma. |
| `<meta>` | Which meta to generate. Accepted values: “title”, “desc”. Optional. Default if not specified: title + meta description. |
| `<language>` | Which language to use to generate the metadata. Optional. Default: en\_US. |
| `<autosave>` | Boolean. Optional. Default: true |

## Generate alternative texts for SEO and accessibility with AI and CLI

```
wp seopress ai alt_text --id=1
```

**Examples**

- Generate alternative texts for a list of media IDs in French language `wp seopress ai alt_text --id=1,2,3,4,5 --language=fr_FR`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<id>` | List of Attachment ID separated by comma. |
| `<language>` | Which language to use to generate the metadata. Optional. Default: en\_US. |
| `<autosave>` | Boolean. Optional. Default: true |
| `<update_empty_alt_text>` | Boolean. Optional. Default: true |

## CLI for global SEO settings

These commands are available with WordPress out of the box. More info on [official website](https://developer.wordpress.org/cli/commands/option/).

### Get global SEO settings

```
wp option get option_name
```

**Examples**

- Get all global Titles and metas settings: `wp option get seopress_titles_option_name`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<option_name>` | The option key. |

### Update global SEO settings

```
wp option patch update option_name foo new
```

**Examples**

- Update the global homepage title from Titles and metas settings with this value “my super homepage title” `wp option patch update seopress_titles_option_name seopress_titles_home_site_title "my super homepage title"`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<option_name>` | The option key. |
| `<key-path>` | The key of the nested array to patch. |
| `<option_value>` | The option value. |

### Delete global SEO settings

```
wp option delete option_name
```

**Examples**

- Delete all global Titles and metas settings: `wp option delete seopress_titles_option_name`

**Parameters**

| **Argument** | **Description** |
| --- | --- |
| `<option_name>` | The option key. |

## Manage your SEOPress PRO license with CLI

### Activate your license

```
wp seopress-pro license activate
```

**Examples**

- Activate a license key: `wp seopress-pro license activate --key=YOUR_LICENSE_KEY`
- Activate using the key already stored in the database: `wp seopress-pro license activate`

**Parameters**

| Argument | Description |
| --- | --- |
| `[--key=<value>]` | The license key to activate. If omitted, uses the key already stored in the database or defined in wp-config.php via `SEOPRESS_LICENSE_KEY`. |

### Deactivate your license

```
wp seopress-pro license deactivate
```

**Examples**

- Deactivate the current license: `wp seopress-pro license deactivate `

### Check your license status

```
wp seopress-pro license status
```

**Examples**

- Display current license status, expiry date and key information: `wp seopress-pro license status`

### Reset your license

Removes the stored license key, status, expiry and all related options from the database.

```
wp seopress-pro license reset
```

**Examples**

- Reset the license and clear the update cache: `wp seopress-pro license reset`

### Update SEOPress PRO

Checks for and installs available SEOPress PRO updates. Requires an active license.

```
wp seopress-pro license update
```

**Examples**

- Check for and install the latest version: `wp seopress-pro license update`
