Add a Custom WP-CLI Command
Registers a "wp site-stats" WP-CLI command that prints counts of posts, pages, comments and users, as a template for your own command-line tools.
Snippet Library
3,040 free snippets from the WPIDE team and the community. Copy the code, or add any snippet to your site in one click with WPIDE.
Registers a "wp site-stats" WP-CLI command that prints counts of posts, pages, comments and users, as a template for your own command-line tools.
Adds a "wp change-status" command that moves posts from one status to another, for example every draft older than a date back to pending, with a preview count before anything changes.
Adds a "wp content-audit" command that shows, per post type, how many items are published, drafts, missing a featured image, missing an excerpt and not updated for two years.
Adds a "wp delete-meta-key" command that removes one custom field key from all posts of a type, for example leftovers from an old SEO or page builder plugin, with a count before anything is deleted.
Adds a "wp list-urls" command that prints the address of every published post, page, custom post and term archive, ready to build a redirect map before a migration or redesign.
Adds a "wp export-json" command that writes published posts with their title, slug, dates, content, excerpt, categories, tags, featured image and author to a JSON file, for static sites, apps or archiving.
Adds a "wp check-internal-links" command that scans published content for links to your own site that no longer point to a post, page or file, and lists them with the post they appear in.
Adds a "wp find-http-links" command that lists posts containing http:// images, scripts or links, marking which point to your own domain, to clean up mixed content after moving to HTTPS.
Adds a "wp find-block" command that lists the content using a given block, such as core/table or a plugin's block, with how many times it appears in each post.
Adds a "wp find-shortcode" command that lists every post, page or custom post that contains a given shortcode, with its status and edit link. Handy before removing a plugin.
Adds a "wp empty-terms" command that lists the terms of a taxonomy that no post uses, and deletes them when you add --delete. The default category is always kept.
Adds a "wp orphaned-meta" command that counts custom field rows left behind by deleted posts, grouped by meta key, and removes them in small batches when you add --delete.
Adds a "wp heaviest-posts" command listing the posts and pages with the largest stored content, revisions excluded, to track down pasted base64 images or page builder bloat slowing the editor.
Adds a "wp largest-meta" command listing the biggest post, user and term meta rows with their key and owner, the quickest way to find plugins bloating the database with huge serialized data.
Adds a "wp meta-keys" command that lists every custom field key used by a post type and how many posts use it, which helps when cleaning up after old plugins or planning a migration.
Adds a "wp shortcodes-in-use" command that scans all content and lists each shortcode tag found, how many posts use it and whether anything is still registered to handle it.
Adds a "wp media-usage" command that totals how much disk space uploads use, grouped by file type or by upload year, including every generated image size, to see what fills your hosting space.
Adds a "wp reassign-posts" command that hands every post of one user to another user, for example when a writer leaves, without deleting the old account.
Notes how every new account was created (registration form, admin screen, checkout, REST API or WP-CLI) and shows it in a "Signed up via" column on the Users screen.
Adds a "wp rename-shortcode" command that changes every use of one shortcode tag to another in posts and pages, attributes and closing tags included, useful when switching plugins.
Adds a "wp missing-alt" command that lists every image in the Media Library without alt text, with the post it is attached to, so you can fix accessibility gaps in order of importance.
Adds a "wp search-content" command that finds an exact word or phrase in titles, content and excerpts of every post type, so you can locate old links, prices or names quickly.
Adds a narrow "ID" column to Network Admin > Sites, handy when a plugin, WP-CLI command or support request asks for a blog ID.
Adds a "wp trim-revisions" command that deletes old revisions but keeps the newest few for every post. It only reports what it would delete until you add --yes.