{"id":430,"date":"2024-06-14T13:42:04","date_gmt":"2024-06-14T13:42:04","guid":{"rendered":"https:\/\/zalvis.com\/docs\/?p=430"},"modified":"2024-06-14T13:45:01","modified_gmt":"2024-06-14T13:45:01","slug":"changing-wordpress-site-url-using-wp-cli","status":"publish","type":"post","link":"https:\/\/zalvis.com\/docs\/changing-wordpress-site-url-using-wp-cli.html","title":{"rendered":"Changing WordPress Site URL using WP-CLI"},"content":{"rendered":"<p><strong>How to Change WordPress URL via WP-CLI<\/strong><\/p>\n<p>Changing WordPress home and site URLs through the admin dashboard is made possible<br \/>\nusing the wp option update command.<\/p>\n<p>To change the home address, run this command:<\/p>\n<blockquote><p>wp option update home \u2018http:\/\/testing.com\u2019<\/p><\/blockquote>\n<p>To change the site URL use this command:<\/p>\n<blockquote><p>wp option update siteurl \u2018http:\/\/testing.com\u2019<\/p><\/blockquote>\n<p><strong>How to Update WordPress via WP-CLI<\/strong><br \/>\nTo update WordPress files and the database use these commands<\/p>\n<p>Update the WordPress files first:<\/p>\n<blockquote><p>wp core update<\/p><\/blockquote>\n<p>To confirm if it is necessary to update the database to the required version:<\/p>\n<blockquote><p>wp core update-db<\/p><\/blockquote>\n<p>Check your WordPress version using this command:<\/p>\n<div class=\"CodeTabs CodeTabs_initial theme-light\">\n<blockquote>\n<div class=\"CodeTabs-toolbar\" role=\"tablist\">wp core version<\/div>\n<\/blockquote>\n<\/div>\n<div class=\"nyuty69da1bb450f91\" >If you enjoyed this article, then you\u2019ll love Zalvis's Cloud Hosting platform. Turbocharge your website and get 24\/7 support from our veteran team. Our world-class hosting infrastructure focuses on auto-scaling, performance, and security. Let us show you the Zalvis difference! <a href=\"https:\/\/zalvis.com\/\">Check out our services.<\/a><\/div><style type=\"text\/css\">\r\n@media screen and (min-width: 1201px) {\r\n.nyuty69da1bb450f91 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 993px) and (max-width: 1200px) {\r\n.nyuty69da1bb450f91 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 769px) and (max-width: 992px) {\r\n.nyuty69da1bb450f91 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 768px) and (max-width: 768px) {\r\n.nyuty69da1bb450f91 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (max-width: 767px) {\r\n.nyuty69da1bb450f91 {\r\ndisplay: block;\r\n}\r\n}\r\n<\/style>\r\n","protected":false},"excerpt":{"rendered":"<p>How to Change WordPress URL via WP-CLI Changing WordPress home and site URLs through the admin dashboard is made possible using the wp option update command. To change the home address, run this command: wp option update home \u2018http:\/\/testing.com\u2019 To change the site URL use this command: wp option update siteurl \u2018http:\/\/testing.com\u2019 How to Update [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-430","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/comments?post=430"}],"version-history":[{"count":3,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/430\/revisions"}],"predecessor-version":[{"id":433,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/430\/revisions\/433"}],"wp:attachment":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/media?parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/categories?post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/tags?post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}