{"id":13786,"date":"2020-09-03T14:26:39","date_gmt":"2020-09-03T14:26:39","guid":{"rendered":"https:\/\/newblog.siteground.com\/en\/?p=13786"},"modified":"2025-09-18T14:40:27","modified_gmt":"2025-09-18T14:40:27","slug":"how-to-optimize-your-agency-workflow-with-wp-cli","status":"publish","type":"post","link":"https:\/\/www.siteground.com\/blog\/how-to-optimize-your-agency-workflow-with-wp-cli\/","title":{"rendered":"How to Optimize Your Agency\u2019s Workflow with WP-CLI Commands"},"content":{"rendered":"\n<p>Is your agency spending a lot of time on busy work and repeating the same efforts time and time again, from one client to the next? Is the development team wasting a lot of their focus and mental energy on menial tasks and boilerplate work? What if you could free up some or all of these resources and invest them into the added value that the client will see and evaluate instead?<\/p>\n\n\n\n<p>WP-CLI is a command-line tool that can help you accelerate the way you interact with WordPress websites. It is also a framework you can use to formalize and automate all of the processes that are shared amongst your clients if you\u2019re a developer or an agency. Because of its versatility and simplicity of use, WP-CLI has been part of SiteGround\u2019s preinstalled toolkit since 2013. SiteGround has also been one of the first sponsors of the project and continues to do so for the past 3 years, 2020 including. <\/p>\n\n\n\n<p>One of the main reasons for SiteGround\u2019s support is the fact that WP-CLI perfectly complements their mission to provide powerful, yet simple to use tools for WordPress processes automation and optimization. In fact, together with SiteGround, we released this awesome webinar for everyone who hasn&#8217;t had the opportunity yet to find out how useful WP-CLI can be:<\/p>\n\n\n\n<iframe width=\"560\" height=\"315\" data-cookieblock-src=\"https:\/\/www.youtube.com\/embed\/DlxbRYpZdQg?si=xYu6LLHsqZXRa9US\" data-cookieconsent=\"marketing\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n\n\n\n<p>As one of the main co-maintainers of the WP-CLI ecosystem, I was really glad to accept this new invitation from SiteGround\u2019s and share some practical tips on how you can make use of WP-CLI to level up your workflows and have your clients get more bang for their buck!<\/p>\n\n\n\n<h2 class=\"has-very-dark-gray-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"accelerating-administrative-efforts\"><\/span>Accelerating administrative efforts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>WP-CLI is first and foremost a direct replacement to a WordPress site&#8217;s admin dashboard. Instead of providing a graphical web interface where you click through menus to get things done, it provides a text-driven command-line interface to perform these same tasks using written wp-cli commands. What at first sounds like added effort eventually turns out to be an infinitely more expressive way of letting the site know what you need to have done, and this makes it scale so much better for complex use cases.<\/p>\n\n\n\n<p>As a result, while it is not necessarily faster to type a command to make a change to a post than it is to click the corresponding button on that same post, the difference becomes more apparent once you deal with multiple posts instead. While you might shudder at the thought of manually making a change on the admin backend to thousands of posts on a large site, all you need for doing so with WP-CLI still happens to be a fairly simple command, usually a one-liner. Granted, it will take a bit more time to execute than it would for a single post, but you can just leave it running in the background and focus on something else in the meantime.<\/p>\n\n\n\n<p>To show an example of this effect, let&#8217;s imagine you have a huge multisite network with thousands of sites. An existing user has proven their worth in terms of helping moderate the entire network and is to be promoted to being an administrator on all the sites. How would you go about doing this via the graphical admin backend?<\/p>\n\n\n\n<p>It turns out that this is quite easy to do via WP-CLI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp site list --field=url | xargs -n1 -I {} wp --url={} user set-role &lt;user-to-promote&gt; administrator<\/code><\/pre>\n\n\n\n<p>The above command will retrieve the list of all site URLs for the network, and for each of these sites, set the role of the user in question to that of &#8220;administrator&#8221;. And while this might take a few minutes to complete, it is a one-liner that does the work for you. Using the web-based admin backend would probably cost you hours to do the same, or require you to write a one-off plugin to do so in a more efficient way.<\/p>\n\n\n\n<p>For an overview of all the bundled commands that come by default with WP-CLI, you can browse the command reference at <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/\">https:\/\/developer.wordpress.org\/cli\/commands\/<\/a>.<\/p>\n\n\n\n<h2 class=\"has-very-dark-gray-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"using-agency-wide-defaults\"><\/span>Using agency-wide defaults<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>WP-CLI supports configuration files at the global level as well as at the project level.<\/p>\n\n\n\n<p>The global configuration file is best used for defining a developer&#8217;s personal preferences. The project-specific configuration file however should best be managed centrally across the agency and treated as a part of the project, just like your composer.json file.<\/p>\n\n\n\n<p>To use a project-specific configuration file, all you need to do is create a wp-cli.yml file within the site&#8217;s root folder. It will accept a few entries that are specific to configuration files, like providing an array of commands to disable for that specific site. But it will also accept default values for any of the available commands with a unified syntax.<\/p>\n\n\n\n<p>Let&#8217;s look at an example configuration file for a hypothetical project:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># WordPress Core is installed in a subfolder.\npath: wp-core\/\n# Load WP-CLI-specific init code before executing a command.\nrequire: wp-cli-init.php\n\n# Provide default flags for the config create command.\nconfig create:\n    dbuser: root\n    dbpass: \n    extra-php: |\n        define( 'WP_DEBUG', true );\n        define( 'WP_POST_REVISIONS', 50 );\n\n# '_' is a special value denoting options for this wp-cli.yml.\n_:\n    # Inherit configuration from an arbitrary YAML file.\n    inherit: agency-defaults.yml\n    # Merge subcommand defaults instead of overriding.\n    merge: true\n<\/code><\/pre>\n\n\n\n<p>As you can see, it is pretty straight-forward to provide defaults for any known command. Also, you can load centralized YAML files within such a project-specific config file as well, if you need it.<\/p>\n\n\n\n<p>You can read more about WP-CLI configuration files at <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/references\/config\/\">https:\/\/make.wordpress.org\/cli\/handbook\/references\/config\/<\/a>.<\/p>\n\n\n\n<h2 class=\"has-very-dark-gray-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"automating-recurring-tasks\"><\/span>Automating recurring tasks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>After you&#8217;ve used the command-line for a while to deal with administrative site work, you might start to notice recurring patterns. Are you always installing the same set of plugins to get started? Are you deleting a set of options from the database every time you want to test the onboarding flow? Maybe you constantly need to reset a user&#8217;s meta values to trigger that one piece of logic in your member&#8217;s area that is constantly being changed?<\/p>\n\n\n\n<p>Instead of needing to remember a list of multiple commands and hopefully typing them without spelling mistakes, you should take a minute and put these into a shell script to automate that work. After all, a shell script is nothing more than a &#8220;step-by-step replay&#8221; of doing something manually in the console.<\/p>\n\n\n\n<p>As an example, here&#8217;s a script that will automate the installation of a new WordPress site:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env bash\n\n# Configure the script to exit immediately if any command fails.\nset -e\n\n# Download WordPress core files.\nwp core download\n\n# Create wp-config.php file.\necho \"Please enter your database credentials:\"\nwp config create --prompt\n\n# Install WordPress.\necho \"Please enter your WordPress installation details:\"\nwp core install --prompt\n\n# Install standard plugins.\necho \"Installing plugins...\"\nwp plugin install query-monitor user-switching wordpress-seo\n\n# Activate and configure a few plugins:\necho \"Configuring plugins...\"\nwp plugin activate wordpress-seo\nwp option patch update wpseo_titles metadesc-home-wpseo \"My new website\"\n\necho \"Done!\"<\/code><\/pre>\n\n\n\n<p>You can, of course, improve this script over time to add more bells &amp; whistles or to give more precise feedback. Sharing it with all of the agency&#8217;s developers makes sure you only need to invest once into the automation part, for everyone to reap the benefits later.<\/p>\n\n\n\n<p>Furthermore, a collection of such scripts makes for excellent onboarding help when new developers join your team.<\/p>\n\n\n\n<h2 class=\"has-very-dark-gray-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"extending-for-custom-use-cases\"><\/span>Extending for custom use cases<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>With more complex projects come more complex administrative requirements. WP-CLI provides its framework to developers so they can easily create their own custom commands to solve very specific business needs in an efficient way.<\/p>\n\n\n\n<p>Running bulk checks across the entire range of an online shop&#8217;s products? No need to build an extra user interface for that &#8211; just wrap the checking logic in a WP-CLI command and you&#8217;re good to go. Then, take it a step further and automate these checks by running that command at a recurring schedule via a cron job!<\/p>\n\n\n\n<p>Note that you can either include these custom commands within a site&#8217;s plugin or theme, or you can publish them as a separate package that can be installed via WP-CLI&#8217;s built-in package manager:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp package install awesome-company\/manage-all-the-things<\/code><\/pre>\n\n\n\n<p>While the range of commands bundled with WP-CLI already covers quite a few use cases, the possibility to build your own custom commands removes any remaining limits and leaves it up to your imagination only as to what you can do.<\/p>\n\n\n\n<h2 class=\"has-very-dark-gray-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"executing-tasks-on-remote-sites\"><\/span>Executing tasks on remote sites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>WP-CLI can connect to remote sites directly via the &#8211;ssh flag, provided that the WP-CLI binary is also installed and accessible on the remote machine:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp --ssh=admin_user@123.456.78.90\/var\/www\/my_site config set WP_DEBUG --raw true<\/code><\/pre>\n\n\n\n<p>What&#8217;s more, you can define aliases to denote the individual machines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wp cli alias add @staging --set-ssh=123.456.78.90 --set-path\/var\/www\/my_site --set-user=admin_user\nwp @staging config set WP_DEBUG --raw true<\/code><\/pre>\n\n\n\n<p>The most powerful property of this is yet to come: you can group these aliases, and run a command on a group of machines instead of only a single machine. The built-in group @all is added by default, running the command on all the machines for which the alias was defined. But you can add your own groups that define a custom subset of machines. Groups can overlap, of course, and groups can contain other groups as well, letting you create an entire hierarchy of site management goodness! With these groups in place, you&#8217;ll do things like update all plugins on all staging sites, or add a user to all of your multisite networks, etc\u2026<\/p>\n\n\n\n<p>Browse to <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/guides\/running-commands-remotely\/\">this link<\/a> to learn more about connecting remotely to your servers or development machines.<\/p>\n\n\n\n<h2 class=\"has-very-dark-gray-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"reaching-for-the-black-belt\"><\/span>Reaching for the black belt<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To truly reap the biggest benefits from WP-CLI, you&#8217;ll want to combine the use of script automation, shared configuration, custom commands, and site aliases to ensure you cannot only address all of your agency&#8217;s usual needs but also do so at the exact point they are needed in one fell swoop.<\/p>\n\n\n\n<p>Keep in mind that most of that work can be shared by and to all the members of the team. The return on the time you invest in this form of tooling will be multiplied by the members on your team that make use of them &#8211; it&#8217;s therefore very hard <em>not<\/em> to get a substantial benefit out of this!<\/p>\n\n\n\n<p>In the end, optimizing the time it requires to deal with menial tasks and streamlining your workflows is what regains this time so you can use it where it matters most &#8211; creating value for your clients and gaining a competitive edge in a crowded market!<\/p>\n\n\n\n<h2 class=\"has-very-dark-gray-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"getting-started\"><\/span>Getting started<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The best place to get started right now is to read the WP-CLI documentation at <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/\">https:\/\/make.wordpress.org\/cli\/handbook\/<\/a> or you can read SiteGround&#8217;s details <a href=\"https:\/\/www.siteground.com\/tutorials\/wordpress\/wp-cli\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"tutorials on WP-CLI (opens in a new tab)\">tutorials on WP-CLI<\/a>. If you hit blocking issues or just have the odd question, head on over to the make.wordpress.org Slack team via <a href=\"https:\/\/make.wordpress.org\/chat\/\">https:\/\/make.wordpress.org\/chat\/<\/a> and join the #cli channel!<br><\/p>\n\n\n<p>[subscribe_cta]<\/p>\n","protected":false},"excerpt":{"rendered":"Is your agency spending a lot of time on busy work and repeating the same efforts time and time again, from one client to the next? Is the development team wasting a lot of their focus and mental energy on menial tasks and boilerplate work? What if you could free up some or all of&hellip;","protected":false},"author":103,"featured_media":13787,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2098,15],"tags":[],"class_list":["post-13786","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting-insights","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.2 (Yoast SEO v24.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Optimize Your Agency\u2019s Workflow with WP-CLI<\/title>\n<meta name=\"description\" content=\"Want to know how to leverage WP-CLI to level up your agency workflow? Read some practical tips by the WP-CLI maintainer Alain Schlesser\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Optimize Your Agency\u2019s Workflow with WP-CLI\" \/>\n<meta property=\"og:description\" content=\"Want to know how to leverage WP-CLI to level up your agency workflow? Read some practical tips by the WP-CLI maintainer Alain Schlesser\" \/>\n<meta property=\"og:url\" content=\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/\" \/>\n<meta property=\"og:site_name\" content=\"SiteGround\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/siteground\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-03T14:26:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-18T14:40:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/fb-1200x630-10.png\" \/>\n<meta name=\"author\" content=\"Alain Schlesser\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Optimize Your Agency\u2019s Workflow with WP-CLI Commands\" \/>\n<meta name=\"twitter:description\" content=\"Is your agency spending a lot of time on busy work and repeating the same efforts time and time again, from one client to the next? Is the development\" \/>\n<meta name=\"twitter:creator\" content=\"@siteground\" \/>\n<meta name=\"twitter:site\" content=\"@siteground\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alain Schlesser\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/\"},\"author\":{\"name\":\"Alain Schlesser\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/#\/schema\/person\/76637dfd059e225ac544ab474c748fb6\"},\"headline\":\"How to Optimize Your Agency\u2019s Workflow with WP-CLI Commands\",\"datePublished\":\"2020-09-03T14:26:39+00:00\",\"dateModified\":\"2025-09-18T14:40:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/\"},\"wordCount\":1636,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg\",\"articleSection\":[\"Hosting Insights\",\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/\",\"url\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/\",\"name\":\"How to Optimize Your Agency\u2019s Workflow with WP-CLI\",\"isPartOf\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg\",\"datePublished\":\"2020-09-03T14:26:39+00:00\",\"dateModified\":\"2025-09-18T14:40:27+00:00\",\"description\":\"Want to know how to leverage WP-CLI to level up your agency workflow? Read some practical tips by the WP-CLI maintainer Alain Schlesser\",\"breadcrumb\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage\",\"url\":\"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg\",\"contentUrl\":\"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/newblog.siteground.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Optimize Your Agency\u2019s Workflow with WP-CLI Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/#website\",\"url\":\"https:\/\/newblog.siteground.com\/en\/\",\"name\":\"SiteGround Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/newblog.siteground.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/#organization\",\"name\":\"SiteGround Blog\",\"url\":\"https:\/\/newblog.siteground.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2025\/01\/Siteground-Logo-on-white.jpg\",\"contentUrl\":\"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2025\/01\/Siteground-Logo-on-white.jpg\",\"width\":1200,\"height\":400,\"caption\":\"SiteGround Blog\"},\"image\":{\"@id\":\"https:\/\/newblog.siteground.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/siteground\",\"https:\/\/x.com\/siteground\",\"https:\/\/www.instagram.com\/siteground\/\",\"https:\/\/www.youtube.com\/@siteground\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/#\/schema\/person\/76637dfd059e225ac544ab474c748fb6\",\"name\":\"Alain Schlesser\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newblog.siteground.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bc791dd5c22bf2050e6769760cc9cc02?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bc791dd5c22bf2050e6769760cc9cc02?s=96&d=mm&r=g\",\"caption\":\"Alain Schlesser\"},\"sameAs\":[\"https:\/\/de.linkedin.com\/in\/schlessera\"],\"url\":\"https:\/\/newblog.siteground.com\/en\/author\/alainschlesser\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Optimize Your Agency\u2019s Workflow with WP-CLI","description":"Want to know how to leverage WP-CLI to level up your agency workflow? Read some practical tips by the WP-CLI maintainer Alain Schlesser","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/","og_locale":"en_US","og_type":"article","og_title":"How to Optimize Your Agency\u2019s Workflow with WP-CLI","og_description":"Want to know how to leverage WP-CLI to level up your agency workflow? Read some practical tips by the WP-CLI maintainer Alain Schlesser","og_url":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/","og_site_name":"SiteGround","article_publisher":"https:\/\/www.facebook.com\/siteground","article_published_time":"2020-09-03T14:26:39+00:00","article_modified_time":"2025-09-18T14:40:27+00:00","og_image":[{"url":"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/fb-1200x630-10.png","type":"","width":"","height":""}],"author":"Alain Schlesser","twitter_card":"summary_large_image","twitter_title":"How to Optimize Your Agency\u2019s Workflow with WP-CLI Commands","twitter_description":"Is your agency spending a lot of time on busy work and repeating the same efforts time and time again, from one client to the next? Is the development","twitter_creator":"@siteground","twitter_site":"@siteground","twitter_misc":{"Written by":"Alain Schlesser","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#article","isPartOf":{"@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/"},"author":{"name":"Alain Schlesser","@id":"https:\/\/newblog.siteground.com\/en\/#\/schema\/person\/76637dfd059e225ac544ab474c748fb6"},"headline":"How to Optimize Your Agency\u2019s Workflow with WP-CLI Commands","datePublished":"2020-09-03T14:26:39+00:00","dateModified":"2025-09-18T14:40:27+00:00","mainEntityOfPage":{"@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/"},"wordCount":1636,"commentCount":0,"publisher":{"@id":"https:\/\/newblog.siteground.com\/en\/#organization"},"image":{"@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg","articleSection":["Hosting Insights","WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/","url":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/","name":"How to Optimize Your Agency\u2019s Workflow with WP-CLI","isPartOf":{"@id":"https:\/\/newblog.siteground.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage"},"image":{"@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg","datePublished":"2020-09-03T14:26:39+00:00","dateModified":"2025-09-18T14:40:27+00:00","description":"Want to know how to leverage WP-CLI to level up your agency workflow? Read some practical tips by the WP-CLI maintainer Alain Schlesser","breadcrumb":{"@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#primaryimage","url":"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg","contentUrl":"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2020\/09\/blog-post-1200x600-9.jpg","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/newblog.siteground.com\/en\/how-to-optimize-your-agency-workflow-with-wp-cli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/newblog.siteground.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to Optimize Your Agency\u2019s Workflow with WP-CLI Commands"}]},{"@type":"WebSite","@id":"https:\/\/newblog.siteground.com\/en\/#website","url":"https:\/\/newblog.siteground.com\/en\/","name":"SiteGround Blog","description":"","publisher":{"@id":"https:\/\/newblog.siteground.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/newblog.siteground.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/newblog.siteground.com\/en\/#organization","name":"SiteGround Blog","url":"https:\/\/newblog.siteground.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newblog.siteground.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2025\/01\/Siteground-Logo-on-white.jpg","contentUrl":"https:\/\/newblog.siteground.com\/en\/wp-content\/uploads\/sites\/2\/2025\/01\/Siteground-Logo-on-white.jpg","width":1200,"height":400,"caption":"SiteGround Blog"},"image":{"@id":"https:\/\/newblog.siteground.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/siteground","https:\/\/x.com\/siteground","https:\/\/www.instagram.com\/siteground\/","https:\/\/www.youtube.com\/@siteground"]},{"@type":"Person","@id":"https:\/\/newblog.siteground.com\/en\/#\/schema\/person\/76637dfd059e225ac544ab474c748fb6","name":"Alain Schlesser","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newblog.siteground.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/bc791dd5c22bf2050e6769760cc9cc02?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bc791dd5c22bf2050e6769760cc9cc02?s=96&d=mm&r=g","caption":"Alain Schlesser"},"sameAs":["https:\/\/de.linkedin.com\/in\/schlessera"],"url":"https:\/\/newblog.siteground.com\/en\/author\/alainschlesser\/"}]}},"_links":{"self":[{"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/posts\/13786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/users\/103"}],"replies":[{"embeddable":true,"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/comments?post=13786"}],"version-history":[{"count":11,"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/posts\/13786\/revisions"}],"predecessor-version":[{"id":19774,"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/posts\/13786\/revisions\/19774"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/media\/13787"}],"wp:attachment":[{"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/media?parent=13786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/categories?post=13786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newblog.siteground.com\/en\/wp-json\/wp\/v2\/tags?post=13786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}