{"id":18398,"date":"2019-12-13T11:48:17","date_gmt":"2019-12-13T16:48:17","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=18398"},"modified":"2021-04-19T13:23:18","modified_gmt":"2021-04-19T17:23:18","slug":"4-ways-to-change-your-website-urls","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/wordpress-tutorials\/4-ways-to-change-your-website-urls\/","title":{"rendered":"4 Ways to Change your Website URLs"},"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><p>Site and Home URLs in WordPress are a core part of the system that the CMS uses to direct user traffic around your website.&nbsp; The important parts that they are responsible for are reporting the domain name and appropriate protocol (HTTP or the secure HTTPS) to browsers that are accessing your website data.&nbsp; Changing your website URLs is how you tell you website to use either a new domain name or change the transfer protocol used for all website content. This guide will demonstrate 4 ways that you can change your website URLs.<\/p>\n<h2 id=\"change-urls-from-the-wordpress-dashboard\">Change URLs from the WordPress Dashboard<\/h2>\n<p>Once you are logged into your website&rsquo;s WordPress, navigate to <b>Settings<\/b> &gt; <b>General<\/b>.<\/p>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-18445 aligncenter\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-01-278x300.png\" alt=\"\" width=\"278\" height=\"300\"><\/a><\/p>\n<p>In the General Settings you will see two fields, <b>WordPress Address<\/b> and <b>Site Address<\/b>, which can be updated to match your new URL requirements.&nbsp; Make sure to <b>Save Changes<\/b> once you have completed your updates.<\/p>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-18446\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-02-300x157.png\" alt=\"\" width=\"300\" height=\"157\"><\/a><\/p>\n<h2 id=\"change-urls-by-editing-wp-configphp\">Change URLs by editing wp-config.php<\/h2>\n<p>You can also set the URLs for your website by editing the code in the wp-config.php contained in your installation&rsquo;s root directory.&nbsp; Add the following example code directly to wp-config.php just above the line <i>\/* That&rsquo;s all, stop editing! Happy blogging. *\/ <\/i>and change example.com to your website&rsquo;s domain name.&nbsp; Make sure the change http to https if you are using an SSL on your website.<\/p>\n<pre>define( 'WP_HOME', 'http:\/\/example.com' );\r\ndefine( 'WP_SITEURL', 'http:\/\/example.com' );<\/pre>\n<h2 id=\"change-urls-directly-in-your-database\">Change URLs directly in your database<\/h2>\n<p>To change the URL information in your website&rsquo;s database you will need a database manager and one of the most common ones is phpMyAdmin.&nbsp; In your database manager open the database associated with your website and select the <b>_options<\/b> table, this where the data for you website URLs are stored.<\/p>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-18447\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-03-300x195.png\" alt=\"\" width=\"300\" height=\"195\"><\/a><\/p>\n<p>The first two rows in the <b>_options<\/b> table control the setting for your URLs and you can selecting the Edit option will allow you to change them.<\/p>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-04.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-18448\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2019\/12\/site-url-04-300x31.png\" alt=\"\" width=\"300\" height=\"31\"><\/a><\/p>\n<h2 id=\"change-urls-with-wp-cli\">Change URLs with WP-CLI<\/h2>\n<p>You can also update your website URLs via SSH using the commands provided by WP CLI.&nbsp;If your <a href=\"\/wordpress-hosting\/\">WordPress hosting<\/a> includes ssh access, connect through SSH and run the following commands to change the URLs:<\/p>\n<pre>wp option update home 'http:\/\/example.com'\r\nwp option update siteurl http:\/\/example.com\"&gt;http:\/\/example.com'<\/pre>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Site and Home URLs in WordPress are a core part of the system that the CMS uses to direct user traffic around your website.&nbsp; The important parts that they are responsible for are reporting the domain name and appropriate protocol (HTTP or the secure HTTPS) to browsers that are accessing your website data.&nbsp; Changing your [&hellip;]<\/p>\n","protected":false},"author":880,"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":[],"class_list":["post-18398","post","type-post","status-publish","format-standard","hentry","category-wordpress-tutorials"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/18398","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\/880"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=18398"}],"version-history":[{"count":4,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/18398\/revisions"}],"predecessor-version":[{"id":36314,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/18398\/revisions\/36314"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=18398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=18398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=18398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}