{"id":4802,"date":"2026-09-21T12:35:38","date_gmt":"2026-09-21T09:35:38","guid":{"rendered":"https:\/\/fastpixel.io\/?post_type=docs&#038;p=4802"},"modified":"2026-09-21T12:35:40","modified_gmt":"2026-09-21T09:35:40","password":"","slug":"wp-cli-support-for-fastpixel","status":"publish","type":"docs","link":"https:\/\/fastpixel.io\/fr\/docs\/wp-cli-support-for-fastpixel\/","title":{"rendered":"WP-CLI Support for FastPixel"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">FastPixel Website Accelerator includes a set of <a href=\"https:\/\/wp-cli.org\/\">WP-CLI<\/a> commands, so you can<br>manage caching directly from the terminal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Requirements:<\/strong> WP-CLI installed on your server (most managed WordPress hosts ship it, run<br><code>wp --info<\/code> to check) and FastPixel active on the site. Run the commands from your WordPress<br>directory, or pass <code>--path=\/path\/to\/wordpress<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">All commands are grouped under <code>wp fastpixel<\/code>. You can always see the built-in help with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp help fastpixel purge<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Purging the cache<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Purge everything<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel purge --all<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Purges the whole FastPixel cache and immediately requests fresh optimization for your pages,<br>the same as the <strong>Purge Cache<\/strong> button in the dashboard. Pages are re-optimized in the background;<br>this may take a few minutes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your site runs behind a supported hosting or server cache (SiteGround, WP Engine, Kinsta,<br>LiteSpeed, Cloudflare and others), that cache is purged automatically at the same time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Purge without re-optimizing right away<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel purge --all --no-request<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Marks the whole cache as outdated but does <strong>not<\/strong> immediately ask for re-optimization, pages are<br>re-optimized when they are next visited. Use this in deploy scripts that run often: it keeps your<br>pageview usage lower than a full purge on every deploy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Purge a single page<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel purge https:\/\/example.com\/sample-page\/\nwp fastpixel purge --post=123<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Purges one page by its URL, or by post\/page\/term ID. The page is re-optimized in the background.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Checking the cache status<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Site overview<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Shows a summary: whether an API key is set, the cache location and size, how many pages are<br>cached, and the current Serve Stale \/ Logged-in Users settings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">A single page<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel status https:\/\/example.com\/sample-page\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Shows whether that page is cached, whether it is waiting to be refreshed, when it was cached,<br>when it was last invalidated, and the last error (if any). Useful when you want to confirm that<br>a specific page was picked up after a purge.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Deleting cached files<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel delete-cached https:\/\/example.com\/sample-page\/\nwp fastpixel delete-cached --all<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Deletes the cached files from disk <strong>without<\/strong> requesting re-optimization, the equivalent of the<br><strong>Delete Cached Files<\/strong> action in the dashboard. Visitors get the regular WordPress page until the<br>page is optimized again. Use <code>purge<\/code> instead when you want the page refreshed right away.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Running diagnostics<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel diag<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Runs the same setup checks as the Diagnostics tab (connectivity, cache directory, configuration).<br>Prints a success message when everything passes, and exits with a non-zero code when something<br>fails, so you can use it in monitoring or CI scripts. For details about a failing check, open<br><strong>FastPixel \u2192 Diagnostics<\/strong> in the WordPress admin.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Managing page exclusions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Page exclusions work exactly like the <strong>Page Exclusions<\/strong> field in the FastPixel settings: excluded<br>pages are not optimized and not served from the cache.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Exclude a page<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel exclude \/checkout\/\nwp fastpixel exclude https:\/\/example.com\/checkout\/\nwp fastpixel exclude sample-page<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can pass a path, a full URL, or a slug (slugs are resolved to the page&#8217;s real permalink).<br>The <code>*<\/code> wildcard is supported for excluding pages in bulk:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel exclude \"\/landing\/*\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Any already-cached files for the excluded page are removed automatically. Excluding the homepage<br>(<code>\/<\/code>) asks for confirmation first \u2014 add <code>--yes<\/code> to skip the prompt in scripts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">List the current exclusions<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel exclude --list<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Remove an exclusion<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel exclude \/checkout\/ --remove<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The page is re-optimized in the background so it becomes cached again.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Using the commands in scripts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every command returns a standard exit code: <code>0<\/code> on success, non-zero on failure \u2014 so they compose<br>cleanly with <code>&amp;&amp;<\/code>, CI pipelines, and monitoring tools.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A typical deploy script step:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># after deploying new code\/content:\nwp fastpixel purge --all --no-request &amp;&amp; wp fastpixel diag<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or refresh only what changed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel purge https:\/\/example.com\/pricing\/\nwp fastpixel status https:\/\/example.com\/pricing\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Multisite<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On a multisite network, target a specific site with WP-CLI&#8217;s standard <code>--url<\/code> flag:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp fastpixel purge --all --url=https:\/\/site-two.example.com<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Command reference<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wp fastpixel purge --all [--no-request]<\/code><\/td><td>Purge the whole cache (optionally without immediate re-optimization)<\/td><\/tr><tr><td><code>wp fastpixel purge &lt;url&gt;<\/code><\/td><td>Purge a single page by URL<\/td><\/tr><tr><td><code>wp fastpixel purge --post=&lt;id&gt;<\/code><\/td><td>Purge a single post, page or term by ID<\/td><\/tr><tr><td><code>wp fastpixel status [&lt;url&gt;]<\/code><\/td><td>Show the cache status, globally or for one page<\/td><\/tr><tr><td><code>wp fastpixel delete-cached &lt;url&gt;|--all<\/code><\/td><td>Delete cached files without re-optimizing<\/td><\/tr><tr><td><code>wp fastpixel diag<\/code><\/td><td>Run the setup diagnostics (non-zero exit code on failure)<\/td><\/tr><tr><td><code>wp fastpixel exclude &lt;page&gt; [--remove] [--list] [--yes]<\/code><\/td><td>Manage page exclusions<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>FastPixel Website Accelerator includes a set of WP-CLI commands, so you canmanage caching directly from the terminal. Requirements: WP-CLI installed on your server (most managed WordPress hosts ship it, runwp &#8211;info to check) and FastPixel active on the site. Run the commands from your WordPressdirectory, or pass &#8211;path=\/path\/to\/wordpress. All commands are grouped under wp fastpixel. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","footnotes":"","_members_access_role":[],"_members_access_error":""},"doc_category":[13],"doc_tag":[],"class_list":["post-4802","docs","type-docs","status-publish","hentry","doc_category-fastpixel-website-accelerator"],"blocksy_meta":[],"year_month":"2026-09","word_count":731,"total_views":"11","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Adrian","author_nicename":"adrian","author_url":"https:\/\/fastpixel.io\/fr\/blog\/author\/adrian\/"},"doc_category_info":[{"term_name":"FastPixel Website Accelerator","term_url":"https:\/\/fastpixel.io\/fr\/docs-category\/fastpixel-website-accelerator\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false,"betterdocs-category-thumb":false},"uagb_author_info":{"display_name":"Adrian","author_link":"https:\/\/fastpixel.io\/fr\/blog\/author\/adrian\/"},"uagb_comment_info":0,"uagb_excerpt":"FastPixel Website Accelerator includes a set of WP-CLI commands, so you canmanage caching directly from the terminal. Requirements: WP-CLI installed on your server (most managed WordPress hosts ship it, runwp --info to check) and FastPixel active on the site. Run the commands from your WordPressdirectory, or pass --path=\/path\/to\/wordpress. All commands are grouped under wp fastpixel.\u2026","_links":{"self":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/docs\/4802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/comments?post=4802"}],"version-history":[{"count":3,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/docs\/4802\/revisions"}],"predecessor-version":[{"id":4805,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/docs\/4802\/revisions\/4805"}],"wp:attachment":[{"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/media?parent=4802"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/doc_category?post=4802"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/fastpixel.io\/fr\/wp-json\/wp\/v2\/doc_tag?post=4802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}