Speed Up Your WordPress Development With Wp-cli

wordpress development with Wp-cli

[vc_row][vc_column][vc_column_text]

  • WordPress Command Line Interface (WP-CLI) tool will enable you to tackle administrative tasks more efficiently.
  • You can create a child theme manually with a single command, you’d not need to go through several steps.

[/vc_column_text][vc_column_text]

Overview of WP-CLI

[/vc_column_text][vc_single_image image=”2931″ img_size=”full”][vc_column_text]

  • This tool makes it easy for WordPress users to interact with the platform.
  • It enables developers to speed up day-to-day tasks by using simple commands
  • The tool supports every action you need to manage a WordPress site, including:
    • Installing the platform
    • Executing WordPress core updates
    • Managing WordPress themes and plugins
    • Creating child themes
    • Importing media files in bulk

[/vc_column_text][vc_column_text]

Setting Up WP-CLI

  • Make sure your hosting environment meets these basic setup requirements.
  • A UNIX-like environment.
  • PHP 5.3.29 (or later).
  • WordPress 3.7 (or later).
  • Secure Shell (SSH) access to your hosting environment.
  • Install the tool by downloading its .phar file using the curl command, as seen below:

[/vc_column_text][vc_single_image image=”2932″ img_size=”full”][vc_column_text]

  • run the following command to make sure the tool is setup properly:

[/vc_column_text][vc_single_image image=”2933″ img_size=”full”][vc_column_text]

  • Now a message similar to this one will display, indicating which version of WP-CLI you’re running:

[/vc_column_text][vc_single_image image=”2934″ img_size=”full”][vc_column_text]

  • At this stage, we recommend you to create an executable file for WP-CLI and move the tool to its own folder (preferably called wp). Here’s the code you’ll need to run to pull it off:

[/vc_column_text][vc_single_image image=”2935″ img_size=”full”][vc_column_text]

  • this will let you use WP-CLI from your own command line with the wp command.

[/vc_column_text][vc_column_text]

3 Ways to Speed Up WordPress Development Using WP-CLI

[/vc_column_text][vc_column_text]

1. Install and Update WordPress

  • locate the directory where you want to set it up and run the following command:

[/vc_column_text][vc_single_image image=”2937″ img_size=”full”][vc_column_text]

  • Next, create a wp-config.php file in the same directory using this code:

[/vc_column_text][vc_single_image image=”2938″ img_size=”full”][vc_column_text]

  • Finally, you’ll need to execute the core install command to finish the process.

[/vc_column_text][vc_single_image image=”2939″ img_size=”full”][vc_column_text]

  • Now update the platform for this use this command:

[/vc_column_text][vc_single_image image=”2941″ img_size=”full”][vc_column_text]

  • Once the platform is fully updated, you’ll want to do the same for your database:

[/vc_column_text][vc_single_image image=”2942″ img_size=”full”][vc_column_text]

2. Manage Your WordPress Themes and Plugins

  • WP-CLI automatically connects to the official WordPress theme and plugin directories
  • You can install both types of add-ons without having to download any files by hand.
  • Here’s the list of the most common commands you’ll need to know to interact with themes and plugins:

Managing Themes

  • Install: wp theme install theme’s_name
  • Activate: wp theme activate theme’s_name
  • Update: wp theme update theme’s_name
  • Update all themes: wp theme update -all

Managing Plugins

  • Install: wp plugin install plugin’s_name
  • Activate:
  • Update: wp plugin update plugin’s_name
  • Update all plugins: wp plugin update -all

3. Create Child Themes

  • Creating a child theme manually is a lengthy process.
  • WP-CLI makes it simpler by using a single command,Here’s how:

[/vc_column_text][vc_single_image image=”2943″ img_size=”full”][vc_column_text]

  • configure the parameters to your specifications.

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][vc_column_text][Echo_Backend_SC post_id=”6646″][/vc_column_text][/vc_column][/vc_row]

Subscribe To Our Newsletter

Get updates and learn from the best