{"id":17496,"date":"2019-06-05T17:56:32","date_gmt":"2019-06-05T21:56:32","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=17496"},"modified":"2021-04-19T12:59:08","modified_gmt":"2021-04-19T16:59:08","slug":"switching-your-theme-via-wp-cli","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/wordpress-tutorials\/switching-your-theme-via-wp-cli\/","title":{"rendered":"Switching your Theme via WP-CLI"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><h1 id=\"switching-your-theme-via-wp-cli\">Switching your Theme via WP-CLI<\/h1>\n<p>If you need to change your Theme when you are not able to access the WordPress Dashboard, one of the fastest methods is to use the WordPress Command Line Interface or WP-CLI. Your <a href=\"\/wordpress-hosting\/\">WordPress hosting<\/a> account will need to include SSH access in order for you to follow along with this guide.<\/p>\n<ol>\n<li><strong>SSH into your WordPress<\/strong> hosting environment, following your Web Host&rsquo;s instructions for doing so.<\/li>\n<li><strong>Change directories<\/strong> to the root directory containing your WordPress installation. In these examples, the directory <strong>~\/public_html<\/strong> is used in place of the root directory for WordPress.\n<pre>user@wordpress [~]$ cd ~\/public_html\/<\/pre>\n<\/li>\n<li><strong>Get a list of your available themes<\/strong> with the command <strong>wp theme list<\/strong>:\n<pre>user@wordpress [~\/public_html]$ wp theme list\r\n+------------------+----------+--------+---------+\r\n| name             | status   | update | version |\r\n+------------------+----------+--------+---------+\r\n| boldgrid-hifidel | inactive | none   | 1.24.3  |\r\n| crio             | active   | none   | 2.1.3   |\r\n| twentynineteen   | inactive | none   | 1.4     |\r\n| twentyseventeen  | inactive | none   | 2.2     |\r\n| twentysixteen    | inactive | none   | 2.0     |\r\n+------------------+----------+--------+---------+\r\n<\/pre>\n<p>In this example, the Theme&nbsp;<strong>Crio<\/strong> is currently active, and the list of names, or&nbsp;<strong>slugs<\/strong>, shows the other themes you have available.<\/p><\/li>\n<li><strong>Switch to another theme<\/strong> with the command <strong>wp theme activate theme-slug,<\/strong> where you replace &ldquo;theme-slug&rdquo; with the name of the theme you are activating:\n<pre>user@wordpress [~\/public_html]$ wp theme activate twentynineteen\r\nSuccess: Switched to 'Twenty Nineteen' theme.<\/pre>\n<p>In this example, the Theme <strong>TwentyNineteen<\/strong> has been activated.<\/p><\/li>\n<li>If you receive an error, you may need to add one of the following modifiers to your command: <strong>&ndash;skip-themes <\/strong>or<strong> &ndash;skip-plugins<\/strong>\n<pre>user@wordpress [~\/public_html]$ wp theme activate twentynineteen --skip-themes --skip-plugins\r\nSuccess: Switched to 'Twenty Nineteen' theme.<\/pre>\n<\/li>\n<\/ol>\n<p>Congratulations! You now know how to switch themes with WP-CLI.<\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Switching your Theme via WP-CLI If you need to change your Theme when you are not able to access the WordPress Dashboard, one of the fastest methods is to use the WordPress Command Line Interface or WP-CLI. Your WordPress hosting account will need to include SSH access in order for you to follow along with [&hellip;]<\/p>\n","protected":false},"author":1294,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"bgseo_title":"","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[151],"tags":[661],"class_list":["post-17496","post","type-post","status-publish","format-standard","hentry","category-wordpress-tutorials","tag-wordpress-tutorial","experience-level-advanced"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/17496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/users\/1294"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=17496"}],"version-history":[{"count":9,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/17496\/revisions"}],"predecessor-version":[{"id":36303,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/17496\/revisions\/36303"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=17496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=17496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=17496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}