Contextual Related Posts CLI (CRP-CLI) offers an efficient way to manage Contextual Related Posts via the command line. This tool is part of Contextual Related Posts Pro starting from version 4.2.0.

About WP-CLI
WP-CLI is a set of command-line tools for managing WordPress installations. You can update plugins, configure multisite installations, and much more, all without using a web browser. For more information, visit the official WP-CLI websiteOpens in a new window.
Getting Started with CRP-CLI
To begin using CRP-CLI, ensure that WP-CLI is installed and that you are running CRP Pro 4.2.0 or later. The CLI commands are accessed through the wp crp command. For a complete list of available commands, type wp crp in your command-line interface.
CRP-CLI Command Tree
Available Commands
All commands are prefixed with wp crp. For example: wp crp cache clear
Cache Commands (wp crp cache)
Manage the plugin’s cache system.
wp crp cache clear
Clear all cached related posts data.
Options:
--network– Clear cache for all sites in a multisite network--url=<url>– Clear cache for specific site URL (multisite only)--blog-id=<id>– Clear cache for specific blog ID (multisite only)--verbose– Show detailed output
Examples:
wp crp cache enable
Enable the CRP cache system.
Options:
--type=<type>– Cache type to enable (posts, html, all) (default: all)--url=<url>– Specific site URL to enable cache for (multisite only)--network– Enable cache for all sites in the network--blog-id=<id>– Specific blog ID to enable cache for (multisite only)
Examples:
wp crp cache disable
Disable the CRP cache system.
Options:
--type=<type>– Cache type to disable (posts, html, all) (default: all)--url=<url>– Specific site URL to disable cache for (multisite only)--network– Disable cache for all sites in the network--blog-id=<id>– Specific blog ID to disable cache for (multisite only)
Examples:
wp crp cache warm
Warm up the cache by pre-generating related posts data.
Options:
--post-ids=<ids>– Comma-separated list of post IDs to warm cache for--post-type=<type>– Specific post type to process (default: post)--limit=<number>– Number of posts to process (default: 100)--recent=<count>– Warm cache for the most recent N posts--all– Warm cache for all posts--popular– Warm cache for popular posts (by comment count)--html– Warm HTML cache instead of posts cache--batch-size=<size>– Batch size for processing (default: 50)--network– Warm cache for all sites in the network--blog-id=<id>– Specific blog ID to warm cache for (multisite only)--force– Force override existing lock file--dry-run– Show what would be processed without making changes--verbose– Show detailed output
Examples:
wp crp cache keys
Show cache keys for posts.
Options:
--post-id=<ids>– Comma-separated list of post IDs to show keys for--url=<url>– Specific site URL (multisite only)--blog-id=<id>– Specific blog ID (multisite only)--verbose– Show detailed output including cache values (posts only)
Examples:
wp crp cache cleanup
Clean up expired cache entries.
Options:
--network– Clean up for all sites in the network--blog-id=<id>– Specific blog ID to clean up for (multisite only)--dry-run– Show what would be cleaned without making changes--verbose– Show detailed output
Examples:
Database Commands (wp crp db)
Manage database operations and migrations.
wp crp db migrate-meta
Migrate meta data from crp_post_meta array to individual _crp_* keys.
Options:
--dry-run– Show what would be migrated without making changes--verbose– Show detailed error messages--batch-size=<number>– Number of posts to process in each batch (default: 100)--network– Migrate meta on all sites in the network--blog-id=<id>– Specific blog ID to migrate meta for (multisite only)
Examples:
wp crp db rollback-meta
Rollback meta migration from individual keys back to array format.
This command will be removed in version v4.3.0 and is not recommended for production sites.
Options:
--dry-run– Show what would be rolled back without making changes--verbose– Show detailed error messages--batch-size=<number>– Number of posts to process in each batch (default: 100)--network– Rollback meta on all sites in the network--blog-id=<id>– Specific blog ID to rollback meta for (multisite only)--force– Force rollback without confirmation
Examples:
wp crp db status
Show database status and migration information.
Options:
--network– Show status for all sites in the network--blog-id=<id>– Specific blog ID to show status for (multisite only)--format=<format>– Output format (table, json, csv, yaml) (default: table)
Examples:
Database Index Commands (wp crp db indexes)
Manage FULLTEXT indexes on core WordPress tables.
wp crp db indexes create
Create FULLTEXT indexes for related posts functionality.
Options:
--dry-run– Show what would be created without making changes--verbose– Show detailed output
Examples:
wp crp db indexes delete
Delete FULLTEXT indexes.
Options:
--dry-run– Show what would be deleted without making changes--force– Force deletion without confirmation
Examples:
wp crp db indexes recreate
Recreate FULLTEXT indexes (delete then create).
Options:
--dry-run– Show what would be recreated without making changes--verbose– Show detailed output
Examples:
wp crp db indexes status
Show FULLTEXT index status.
Examples:
Tables Commands (wp crp tables)
Manage custom tables for efficient content storage.
wp crp tables create
Create custom tables for CRP Pro.
Options:
--dry-run– Show what would be created without making changes--verbose– Show detailed output
Examples:
wp crp tables drop
Drop custom tables.
Options:
--force– Force table deletion without confirmation--dry-run– Show what would be dropped without making changes
Examples:
wp crp tables status
Show the custom tables’ status.
Options:
--network– Show status for all sites in the network--blog-id=<id>– Specific blog ID to show status for (multisite only)--format=<format>– Output format (table, json, csv, yaml) (default: table)
Examples:
wp crp tables recreate
Drop and recreate custom tables from scratch. All indexed data will be permanently lost. Run wp crp tables index afterwards to repopulate the tables.
Options:
--force– Skip confirmation prompt--dry-run– Show what would be done without making changes
Examples:
wp crp tables convert-innodb
Convert the custom table storage engine to InnoDB. FULLTEXT indexes are automatically regenerated after conversion. This operation may take some time on large tables.
Options:
--force– Skip confirmation prompt--dry-run– Show what would be done without making changes
Examples:
wp crp tables index
Index posts into custom tables.
Options:
--batch-size=<size>– Batch size for processing (default: 50)--network– Index posts for all sites in the network--blog-id=<id>– Specific blog ID to index posts for (multisite only)--force– Force indexing even if a lock file exists--dry-run– Show what would be indexed without making changes--verbose– Show detailed output
Examples:
Tables Index Commands (wp crp tables indexes)
Manage FULLTEXT indexes on custom tables.
wp crp tables indexes create
Create FULLTEXT indexes for custom tables.
Options:
--network– Create indexes for all sites in a multisite network--dry-run– Show what would be created without making changes--verbose– Show detailed output
Examples:
wp crp tables indexes delete
Delete FULLTEXT indexes from custom tables.
Options:
--network– Delete indexes for all sites in a multisite network--dry-run– Show what would be deleted without making changes--force– Force deletion without confirmation--verbose– Show detailed output
Examples:
wp crp tables indexes recreate
Recreate FULLTEXT indexes for custom tables.
Options:
--network– Recreate indexes for all sites in a multisite network--dry-run– Show what would be recreated without making changes--verbose– Show detailed output
Examples:
wp crp tables indexes status
Show FULLTEXT index status for custom tables.
Options:
--network– Show status for all sites in the network--blog-id=<id>– Specific blog ID to show status for (multisite only)--format=<format>– Output format (table, json, csv, yaml) (default: table)
Examples:
Related Commands (wp crp related)
Show related posts for a specific post.
Arguments:
<post-id>– Post ID to show related posts for
Options:
--limit=<number>– Number of related posts to show. Default: 10.--url=<url>– Site URL on multisite.--blog-id=<id>– Site ID on multisite.--format=<format>– Output format: table, JSON, CSV, or YAML.
wp crp related 123
wp crp related 123 --limit=5
wp crp related 123 --format=jsonExclude Commands (wp crp exclude)
Manage posts excluded from related-post results.
wp crp exclude add
Exclude a post by ID:
wp crp exclude add 123wp crp exclude remove
Restore an excluded post:
wp crp exclude remove 123wp crp exclude list
List excluded posts. The command returns up to 100 posts by default and supports a maximum limit of 1,000.
wp crp exclude list
wp crp exclude list --limit=250 --offset=100
wp crp exclude list --format=jsonOptions:
--limit=<number>– Maximum posts to return. Default: 100.--offset=<number>– Number of posts to skip. Default: 0.--format=<format>– Output format: table, JSON, or CSV.
Settings Commands (wp crp settings)
Manage Contextual Related Posts settings as JSON.
wp crp settings export
wp crp settings export
wp crp settings export --file=my-settings.jsonThe --file option sets the output filename. The default is settings.json.
wp crp settings import
wp crp settings import settings.json
wp crp settings import settings.json --merge
wp crp settings import settings.json --forceUse --merge to retain settings absent from the file. Without it, the imported settings replace the current array. Use --force to skip confirmation.
wp crp settings get
wp crp settings get cache
wp crp settings get cache --format=jsonThe output format can be table, JSON, CSV, YAML, or a single value.
wp crp settings set
wp crp settings set cache true --type=bool
wp crp settings set limit 10 --type=int
wp crp settings set post_types "post,page"The --type option accepts string, integer, boolean, or array values. Use --force to skip confirmation.
Status Command (wp crp status)
Show plugin, WordPress, PHP, database, cache, FULLTEXT index, and custom-table status.
wp crp status
wp crp status --format=json
wp crp status --verboseThe output format can be table, JSON, or CSV. On multisite, use the standard WP-CLI --url option to target a site.

Efficient Content Storage and Indexing (ECSI) in Contextual Related Posts Pro and Better Search Pro