{"id":34647,"date":"2021-12-29T16:56:49","date_gmt":"2021-12-29T16:56:49","guid":{"rendered":"https:\/\/www.hostduplex.com\/kb\/?post_type=ht_kb&#038;p=34647"},"modified":"2021-12-29T18:15:48","modified_gmt":"2021-12-29T18:15:48","slug":"how-to-change-wordpress-url","status":"publish","type":"ht_kb","link":"https:\/\/www.hostduplex.com\/kb\/article\/how-to-change-wordpress-url\/","title":{"rendered":"How to change WordPress URL"},"content":{"rendered":"\n<p>Your WordPress address references both the address of your site on the web and the location of your site\u2019s files and admin screens. Because of its importance, there are many reasons why you might need or want to modify it. Perhaps you\u2019re&nbsp;changing domains,&nbsp;moving to a subdomain, updating from www to non-www, moving files around, or even&nbsp;migrating from HTTP to HTTPS. <\/p>\n\n\n\n<p>This article will show you three different methods you can use to change the URL of your WordPress site.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Change WordPress Site URLs from Admin Area<\/strong><\/h3>\n\n\n\n<p>Login to your WordPress dashboard and go to <strong>Settings \u00bb General<\/strong>.<\/p>\n\n\n\n<p>Here, you can change your WordPress site URLs in the \u2018WordPress Address\u2019 and \u2018Site Address\u2019 boxes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"230\" src=\"https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/wordpress-address-site-address.png\" alt=\"\" class=\"wp-image-34648\" title=\"Change WordPress address and site address - WPBeginner\" srcset=\"https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/wordpress-address-site-address.png 680w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/wordpress-address-site-address-300x101.png 300w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/wordpress-address-site-address-50x17.png 50w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/wordpress-address-site-address-60x20.png 60w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/wordpress-address-site-address-100x34.png 100w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<p>For most websites, these will be the same URL.<\/p>\n\n\n\n<p>After that, click the \u2018Save Changes\u2019 button.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>Change WordPress Site URLs Using functions.php File<\/strong><\/h3>\n\n\n\n<p>If you cannot access your WordPress admin panel for any reason, then you\u2019ll need to use this method.<\/p>\n\n\n\n<p>First, you need to connect to your WordPress site using an FTP client.<\/p>\n\n\n\n<p>Relat<a href=\"https:\/\/www.hostduplex.com\/kb\/article\/what-is-filezilla\/\">ed: How to connect to your account using FTP?<\/a><\/p>\n\n\n\n<p>Then, you need to locate your WordPress theme folder. For most users this will be something like <strong>\/wp-content\/themes\/your-theme-folder\/<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"245\" src=\"https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-functions-php-file.png\" alt=\"\" class=\"wp-image-34649\" title=\"Locate functions.php file via FTP - WPBeginner\" srcset=\"https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-functions-php-file.png 680w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-functions-php-file-300x108.png 300w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-functions-php-file-50x18.png 50w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-functions-php-file-60x22.png 60w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-functions-php-file-100x36.png 100w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<p>In this folder, you need to open your <em>functions.php<\/em> file and edit it. Add the following code to the bottom of the file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">update_option( 'siteurl', 'https:\/\/example.com' );update_option( 'home', 'https:\/\/example.com' );<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Change WordPress Site URLs Using wp-config.php File<\/strong><\/h3>\n\n\n\n<p>If you\u2019re not sure which WordPress theme you need to edit, or can\u2019t find your functions.php file, then you can use this method.<\/p>\n\n\n\n<p>To change this file you\u2019ll need to connect to your website using an FTP client. Then, you need to locate the wp-config.php file, which can normally be found in the root folder for your domain.<\/p>\n\n\n\n<p> Related:<a href=\"https:\/\/www.hostduplex.com\/kb\/article\/what-is-filezilla\/\"> How to connect to your account using FTP?<\/a> <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"183\" src=\"https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-wp-config-file.png\" alt=\"\" class=\"wp-image-34651\" srcset=\"https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-wp-config-file.png 680w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-wp-config-file-300x81.png 300w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-wp-config-file-50x13.png 50w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-wp-config-file-60x16.png 60w, https:\/\/www.hostduplex.com\/kb\/wp-content\/uploads\/2021\/12\/ftp-wp-config-file-100x27.png 100w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure>\n\n\n\n<p>After that, you need to add the following code just above the line that says \u2018That\u2019s all, stop editing! Happy publishing\u2019.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">define( 'WP_HOME', 'https:\/\/example.com' );define( 'WP_SITEURL', 'https:\/\/example.com' );<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-background has-purple-background-color has-purple-color\"\/>\n\n\n\n<p>If you are a Host Duplex customer and still have questions, please open a ticket in the&nbsp;<a href=\"https:\/\/secure.hostduplex.com\/clientarea.php\" target=\"_blank\" rel=\"noopener\">Host Duplex client portal.<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Your WordPress address references both the address of your site on the web and the location of your site\u2019s files and admin screens. Because of its importance, there are many reasons why you might need or want to modify it. Perhaps you\u2019re&nbsp;changing domains,&nbsp;moving to a subdomain, updating from www to&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"ht-kb-category":[163],"ht-kb-tag":[236,162,238,45],"class_list":["post-34647","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-wordpress","ht_kb_tag-change-url","ht_kb_tag-domain","ht_kb_tag-website-url","ht_kb_tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/comments?post=34647"}],"version-history":[{"count":2,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34647\/revisions"}],"predecessor-version":[{"id":34652,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb\/34647\/revisions\/34652"}],"wp:attachment":[{"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/media?parent=34647"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=34647"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.hostduplex.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=34647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}