Skip to main content

WP-CLI Cheatsheet

Run WP-CLI against the id86.net WordPress install. All commands assume the WordPress path /home/Dmg59ZFtKg6bIws1/id86net/public_html (the sudo user wrapper sudo -u Dmg59ZFtKg6bIws1 -- wp --path=... on GC-US-M10).

Posts & Meta

TaskCommand
Get post by IDwp post get <id>
Get post URLwp post get <id> --field=url
Set publish date (date-only)wp post update <id> --post_date='2026-08-10'
Get custom metawp post meta get <id> <key>
Update custom metawp post meta update <id> <key> <value>
Delete custom metawp post meta delete <id> <key>
List posts by slugwp post list --post_type=post --name=<slug> --fields=ID,post_title,post_status
Trash a postwp post delete <id>
Force delete a postwp post delete <id> --force

Caches

TaskCommand
Purge LiteSpeed targeted (one URL)curl -ksS --resolve id86.net:443:127.0.0.1 "https://id86.net/<slug>/?LSCWP_CTRL=PURGESINGLE"
Purge LiteSpeed full (structural)curl -ksS --resolve id86.net:443:127.0.0.1 "https://id86.net/?LSCWP_CTRL=purge_all"
Flush PHP OPcachewp flush-opcache flush
Rebuild Fuse.js search indexwp fusejs generate-index

LiteSpeed: wp litespeed-purge all is blocked by Cloudflare Access (no-op). Use the origin-direct forms; default is targeted per URL. See LiteSpeed Cache CLI.

ID86 Meta Keys

Meta KeyPurpose
_id86_doc_idStable document identifier from frontmatter id
_id86_source_pathRepository-relative source path (post matching)
_id86_source_hashSHA-256 of file (change detection)
_id86_content_typeContent-type badge. Registered values: cheatsheet/reference/checklist/glossary/prompt/snippet/pattern/template/runbook/other. Set via the editor's Content Type metabox or wp post meta update <id> _id86_content_type <value>. Sync defaults to reference only when the meta is empty (manual choices are preserved)
post_views_countIncremented per view (popular-post query)

Options

TaskCommand
Get an optionwp option get <name>
Update an optionwp option update <name> <value>
Delete an optionwp option delete <name>
Patch a nested optionwp option patch update <name> <key> <value>

Examples:

wp option get id86_reoon_api_key
wp option update id86_reoon_api_key "$(source ~/.ssh/reoon/.env && printf '%s' "$REOON_API_KEY")"

SEOPress

TaskCommand
Export settingswp seopress settings export --destination='.../uploads/seopress'
Import settingswp seopress settings import --from='.../uploads/seopress'
Post SEO titlewp post meta update <id> _seopress_titles_title "..."
Post SEO descriptionwp post meta update <id> _seopress_titles_desc "..."
Generate AI metadatawp seopress ai metadata --id=1,2,3 --meta=desc --language=en_US
Generate AI alt textwp seopress ai alt_text --id=1,2,3 --language=en_US
License activatewp seopress-pro license activate --key=YOUR_LICENSE_KEY
License statuswp seopress-pro license status

SEO title/description meta is written automatically by the sync pipeline on every create/update — the commands above are for manual override/verification only. See SEO Metadata Automation.

Cron

TaskCommand
List cron eventswp cron event list --fields=hook,next_run_relative,status
Run due events nowwp cron event run --due-now

Notes

  • WordPress auto-converts a post with a future post_date to future status and publishes it when the scheduler runs — this is how frontmatter date schedules posts.
  • Post date accepts date-only (YYYY-MM-DD); time defaults to 00:00:00.
  • Never expose secrets via wp option get output in logs or screenshots.