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
Snippets for developers: debugging helpers, custom cron schedules, body classes, REST API tweaks and admin tools for checking hooks and queries. Building blocks for people who write code for WordPress every day.
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.
Lets REST API clients request posts with orderby=rand, for example to show a few random articles in an app, which WordPress does not allow by default.
Adds an author_details field with the author's display name, profile link and avatar URL to every post in the REST API, saving apps a second request or a heavy _embed call.
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 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.
Lets a classic theme use single-cat-{slug}.php for posts in a given category, for example a recipe layout for posts filed under Recipes, falling back to the normal template.
Registers a read-only endpoint at /wp-json/wpide/v1/latest that returns your latest posts in a compact format, as a starting point for your own API routes.
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 featured_image_url field to posts and pages in REST API responses, so headless front ends do not need a second request.
Lets REST API requests filter posts by custom fields you allow, e.g. /wp-json/wp/v2/posts?meta_key=location&meta_value=paris, for apps and headless front ends.
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 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.
Lets administrators add ?wpide_query=1 to a front-end URL to print the main query's variables, the SQL it ran and the number of posts found at the bottom of the page.
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 reassign-posts" command that hands every post of one user to another user, for example when a writer leaves, without deleting the old account.
Adds a navigation field to single posts in the REST API with the ID, title and link of the previous and next posts, so apps can build "read next" buttons.
Lets REST API requests for posts and pages ask for more than 100 items at once, useful for exports and static site generators.
Adds a public /wp-json/site/v1/random endpoint that returns one random published post with its title, link and excerpt, for "surprise me" buttons or widgets.
Adds an "Archived" status for posts that should leave the site without being deleted, with its own filter link in the Posts list and a status choice in the editor.
Changes the labels of the built-in Posts type to "Articles" across the admin menu, screens and editor, for sites where "posts" means something else.