{"id":9959,"date":"2022-05-27T11:32:21","date_gmt":"2022-05-27T15:32:21","guid":{"rendered":"https:\/\/kb.n0c.com\/?post_type=ht_kb&#038;p=9959"},"modified":"2026-07-22T15:23:09","modified_gmt":"2026-07-22T19:23:09","slug":"managing-wordpress-in-cli-with-wp-cli","status":"publish","type":"ht_kb","link":"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/","title":{"rendered":"How to Manage WordPress in CLI with wp-cli"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>You can install and configure a new WordPress site with N0C (see the article <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/using-wordpress-on-n0c\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Use WordPress<\/a>). However, sometimes it can be advantageous to install a WordPress site in command line. To do this, you need to use the <meta charset=\"utf-8\"><strong><code>wp-cli<\/code><\/strong> tool.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-danger\"><strong>Warning :<\/strong> The article does not explain how to design a website in WordPress, which you can find in the WordPress Support on the Web: <a href=\"https:\/\/wordpress.org\/support\/\">https:\/\/wordpress.org\/support\/<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Note :<\/strong> The&nbsp;<a href=\"https:\/\/kb.n0c.com\/en\/glossary\/\">N0C Glossary<\/a>&nbsp;contains explanations on multiple topics and can be consulted to clarify certain terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Preparation<\/h2>\n\n\n\n<p>Enter the following address in your web browser: <a href=\"https:\/\/mg.n0c.com\/en\/\">https:\/\/mg.n0c.com\/en\/<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Note :<\/strong> wp-cli is installed natively with the automatic installer of N0C and it is accessible in SSH via the <strong><code>wp<\/code><\/strong> command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><meta charset=\"utf-8\"><meta charset=\"utf-8\">Installing a WordPress Website<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Preparation<\/h3>\n\n\n\n<p>To install a WordPress site on the hosting with the help of <meta charset=\"utf-8\"><code>wp-cli<\/code>, you must first :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a database, a user with a password and authorize the database user with the N0C panel (please refer to the article <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-manage-mysql-and-postgresql-databases\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Manage MySQL and PostgreSQL Databases<\/a>).<\/li>\n\n\n\n<li>Logging in with a password (please refer to the article <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-create-an-ssh-key-and-connect-to-an-account\/#remote-connection-to-a-hosting-with-a-private-ssh-key:~:text=and%20Chrome%20OS.-,Remote%20connection%20with%20SSH%20key%20under%20MS%2DWindows,-Step%201%20%E2%80%93%20Create\" target=\"_blank\" rel=\"noreferrer noopener\">How to Create an SSH Key and Connect to an Account Remotely<\/a>).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of the Website<\/h3>\n\n\n\n<p>The process is explained with the help of an example, where we will install a WordPress website in the <meta charset=\"utf-8\"><code>public_html<\/code>directory of the hosting. In this example, the dummy address of the site that points to this directory is <strong>https:\/\/mydomain.ca<\/strong> :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em># Downloading WordPress<\/em>\nwp core download\n<em># Production of the configuration file<\/em>\ncd ~\/public_html\nwp core config --dbname=\"database_wp\" --dbuser=\"user_wp\" --dbprefix=\"mywp_\" --dbpass=\"pass_database\"\n<em># Launching the installation<\/em>\nwp core install --url=\"https:\/\/mydomain.ca\" --title=\"Site WordPress\" --admin_user=\"adminname\" --admin_password=\"mypassword\" --admin_email=\"admin@test123.ca\"\n<em># Change of link structure to keep the article name only<\/em>\nwp rewrite structure '\/%nameofpost%'<\/pre>\n\n\n\n<p>Where :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><strong>database<\/strong>_wp<\/strong>: database name.<\/li>\n\n\n\n<li><strong>user_wp<\/strong>: database username.<\/li>\n\n\n\n<li><strong>mywp_<\/strong>: the prefix.<\/li>\n\n\n\n<li><strong>pass_database<\/strong>: password to access to the database.<\/li>\n\n\n\n<li><strong>Site WordPress<\/strong>: name of the site.<\/li>\n\n\n\n<li><strong>adminname<\/strong>: name of the administrator.<\/li>\n\n\n\n<li><strong>mypassword<\/strong>: password of the administrator.<\/li>\n\n\n\n<li><strong style=\"color: initial; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &quot;Helvetica Neue&quot;, sans-serif;\">admin@test123.ca<\/strong><span style=\"color: initial; font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Oxygen-Sans, Ubuntu, Cantarell, &quot;Helvetica Neue&quot;, sans-serif;\">: e-mail of the administrator.<\/span><\/li>\n\n\n\n<li><strong>nameofpost<\/strong>: post name.<\/li>\n<\/ul>\n\n\n\n<p>By default, the language of WordPress is English. However, should you need to define another language, you would have to enter the following command (in this exemple, French is chosen):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em># Changing the WordPress language for French<\/em>\n<meta charset=\"utf-8\">wp core language list\nwp core language <strong>install<\/strong> --activate fr_FR<\/pre>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Note :<\/strong> It is best to use alphanumeric characters for passwords (avoid special characters).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation of a Theme<\/h3>\n\n\n\n<p>A new custom theme available in the WordPress theme repository can be installed. The command also allows you to specify a link to the zip archive of a theme or an HTTPS address to a themes zip file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># <em>Display the list of themes that can be found in the installation<\/em>\nwp theme list\n# <em>Installation of a new theme (generatepress)<\/em>\n# https:\/\/wordpress.org\/themes\/generatepress\/\nwp theme install generatepress\n<em># Activation of the theme<\/em>\nwp theme activate generatepress<\/pre>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Note :<\/strong> After activation, if an error indicates that the parent theme is needed, just install it with the command &#8220;<em>wp theme install<\/em>&#8221; followed by the theme name.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><meta charset=\"utf-8\">Installation of a Plug-In<\/h3>\n\n\n\n<p>To install a plug-in, you just have to give the name of the plug-in and the command will automatically fetch it from the WordPress repositories. The command also allows you to indicate a path to a zip file of an extension or an HTTPS address to a zip file of plug-ins.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em># Display of the list of detected plug-ins<\/em>\nwp plugin list\n<em># Installation of the classic-editor plug-in<\/em>\nwp plugin install classic-editor\n<em># Activation of the plug-in<\/em>\nwp plugin activate classic-editor<\/pre>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\"><strong>Note :<\/strong> The &#8220;&#8211;activate&#8221; command allows you to activate and install the plug-in at the same time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Updates<\/h3>\n\n\n\n<p>The wp-cli tool allows you to manage updates for WordPress, themes and plug-ins. However, each module must be updated individually using the <meta charset=\"utf-8\"><code>update<\/code> command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># <em>Check to see if updates are available<\/em>\nwp core check-update\n# <em>WordPress<\/em> <em>core update<\/em>\nwp core update\n# <em>Database update<\/em>\nwp core update-db\n# <em>Check to see if extension updates are available<\/em>\nwp plugin update --all --dry-run\n# <em>Update all plug-ins<\/em>\nwp plugin update --all\n# <em><em><em>Check to see if themes updates are available<\/em><\/em><\/em>\nwp theme update --all --dry-run\n<meta charset=\"utf-8\"># <em>Update all themes<\/em>\nwp theme update --all<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to Modify the Password<\/h2>\n\n\n\n<p>Please refer to the section <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-change-the-wordpress-admin-login-password\/#change-password-in-command-line-with-wp-cli:~:text=Use%20WordPress.-,Change%20Password%20in%20Command%20Line%20with%20wp%2Dcli,-As%20explained%20in\">Change Password in Command Line with wp-cli <\/a>in the article <a href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/how-to-change-the-wordpress-admin-login-password\/\">How to Change the WordPress Admin Login Password<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">References About wp-cli Commands<\/h2>\n\n\n\n<p>The basic wp-cli commands are available via this link: <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/\">https:\/\/developer.wordpress.org\/cli\/commands\/<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction You can install and configure a new WordPress site with N0C (see the article How to Use WordPress). However, sometimes it can be advantageous to install a WordPress site in command line. To do this, you need to use the wp-cli tool. Preparation Enter the following address in your&#8230;<\/p>\n","protected":false},"author":4,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[170],"ht-kb-tag":[],"class_list":["post-9959","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-cms-applications-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Manage WordPress in CLI with wp-cli - N0C KB<\/title>\n<meta name=\"description\" content=\"This article explains how to install a WordPress site using the command line. To do this, you need to use the wp-cli tool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-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 Manage WordPress in CLI with wp-cli - N0C KB\" \/>\n<meta property=\"og:description\" content=\"This article explains how to install a WordPress site using the command line. To do this, you need to use the wp-cli tool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/\" \/>\n<meta property=\"og:site_name\" content=\"N0C KB\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-22T19:23:09+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/managing-wordpress-in-cli-with-wp-cli\\\/\",\"url\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/managing-wordpress-in-cli-with-wp-cli\\\/\",\"name\":\"How to Manage WordPress in CLI with wp-cli - N0C KB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/#website\"},\"datePublished\":\"2022-05-27T15:32:21+00:00\",\"dateModified\":\"2026-07-22T19:23:09+00:00\",\"description\":\"This article explains how to install a WordPress site using the command line. To do this, you need to use the wp-cli tool.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/managing-wordpress-in-cli-with-wp-cli\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/managing-wordpress-in-cli-with-wp-cli\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/managing-wordpress-in-cli-with-wp-cli\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/kb.n0c.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\\\/\\\/kb.n0c.com\\\/en\\\/knowledge-base\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Manage WordPress in CLI with wp-cli\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kb.n0c.com\\\/#website\",\"url\":\"https:\\\/\\\/kb.n0c.com\\\/\",\"name\":\"N0C KB\",\"description\":\"Official documentation of the N0C hosting platform\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kb.n0c.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Manage WordPress in CLI with wp-cli - N0C KB","description":"This article explains how to install a WordPress site using the command line. To do this, you need to use the wp-cli tool.","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:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/","og_locale":"en_US","og_type":"article","og_title":"How to Manage WordPress in CLI with wp-cli - N0C KB","og_description":"This article explains how to install a WordPress site using the command line. To do this, you need to use the wp-cli tool.","og_url":"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/","og_site_name":"N0C KB","article_modified_time":"2026-07-22T19:23:09+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/","url":"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/","name":"How to Manage WordPress in CLI with wp-cli - N0C KB","isPartOf":{"@id":"https:\/\/kb.n0c.com\/#website"},"datePublished":"2022-05-27T15:32:21+00:00","dateModified":"2026-07-22T19:23:09+00:00","description":"This article explains how to install a WordPress site using the command line. To do this, you need to use the wp-cli tool.","breadcrumb":{"@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.n0c.com\/en\/knowledge-base\/managing-wordpress-in-cli-with-wp-cli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/kb.n0c.com\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/kb.n0c.com\/en\/knowledge-base\/"},{"@type":"ListItem","position":3,"name":"How to Manage WordPress in CLI with wp-cli"}]},{"@type":"WebSite","@id":"https:\/\/kb.n0c.com\/#website","url":"https:\/\/kb.n0c.com\/","name":"N0C KB","description":"Official documentation of the N0C hosting platform","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.n0c.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb\/9959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/comments?post=9959"}],"version-history":[{"count":28,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb\/9959\/revisions"}],"predecessor-version":[{"id":21751,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb\/9959\/revisions\/21751"}],"wp:attachment":[{"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/media?parent=9959"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb-category?post=9959"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.n0c.com\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=9959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}