{"id":7149,"date":"2020-05-10T15:00:51","date_gmt":"2020-05-10T13:00:51","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=7149"},"modified":"2020-10-30T15:55:57","modified_gmt":"2020-10-30T14:55:57","slug":"how-to-change-wordpress-url","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/how-to-change-wordpress-url\/","title":{"rendered":"How to Change Your WordPress URL"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]There is a multitude of reasons why you might need to change WordPress URLs\u00a0 occasionally. However, it is not always clear when and how you can do it. This is why we decided to shine some light on the topic.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]We use the term <em>WordPress URLs<\/em> to refer to two addresses \u2013 <strong>the WordPress address and the site address<\/strong>. In most cases, the WordPress and the site address should be the same. The WordPress address represents the location of core WordPress files. So, when you use this address (i.e. the <strong>your-wordpress-url\/wp-admin<\/strong> URL) you log in to your admin dashboard. If the location of your WordPress core files changes (e.g. when <a href=\"https:\/\/qodeinteractive.com\/magazine\/install-wordpress-in-subdirectory\">creating a subdirectory<\/a>), your WordPress address also needs to change to keep everything working normally.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]On the other hand, your site address is the address your visitors type into their browser to access the website (i.e. its frontend). Most of the time, both the WordPress and site address are the same. However, now that you know what each address represents, you won\u2019t be confused if you find that the addresses differ. Let\u2019s take a look at the cases in which you can change your WordPress URLs and how you should do it. To help you navigate, we\u2019ve broken this article down into the following topics:[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#via-admin-dashboard\">Changing WordPress URLs via admin dashboard<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#by-editing-the-wp-config-php-file\">Changing WordPress URLs by editing the wp-config.php file<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#by-editing-the-functions-php-file\">Changing WordPress URLs by editing the functions.php file<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#by-editing-the-database\">Changing WordPress URLs by editing the database<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;70px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">When to Change WordPress URL<\/h2>\n<p>[\/vc_column_text][vc_column_text]There are various circumstances that might require you to change your WordPress URLs. For example, <a href=\"https:\/\/www.google.com\/url?q=https:\/\/qodeinteractive.com\/magazine\/add-ssl-wordpress\/&amp;sa=D&amp;ust=1586517075159000&amp;usg=AFQjCNH7gv_duY8_Kli1QthgEOHX4xvkxg\" target=\"_blank\" rel=\"noopener noreferrer\">switching your site from HTTP to HTTPS<\/a>. It\u2019s a must if you\u2019re <strong>changing domains or creating subdirectories or migrating your site from a local server<\/strong>. Also, changing WordPress URLs is a valid troubleshooting step as well, especially if you\u2019re facing redirect errors. Alternatively, you can <strong>change your URLs to make them more SEO friendly<\/strong>. Whatever your reason may be, knowing how to change WordPress URLs will be useful on many different occasions.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">How to Change WordPress URLs<\/h2>\n<p>[\/vc_column_text][vc_column_text]There are several ways to change WordPress URLs. We are going to explain the most common ones, going from least to most challenging methods. However, <strong>applying some of them will require you to edit important WordPress files or even the database itself<\/strong>, so it is essential that you <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-manually-backup-wordpress-website\/\">backup your site<\/a> in advance. Once you\u2019ve done that, you can proceed to change your URLs using one of the methods described below.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"via-admin-dashboard\"><\/a>How to Change WordPress URLs via Admin Dashboard<\/h3>\n<p>[\/vc_column_text][vc_column_text]If you can log in to your dashboard and have the permissions to change both the WordPress and site address, this is the method we recommend.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Log in to your dashboard<\/strong> using your admin credentials and navigate to <em>Settings &gt; General<\/em>. Now you only need to update the <strong>WordPress Address (URL) and the Site Address (URL) fields<\/strong> by typing the new addresses for each of them. To finish, simply press <strong>the Save Changes button<\/strong> in the corner of your screen.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/1-Navigate-to-Settings.jpg\" class=\"attachment-full size-full\" alt=\"Navigate to Settings\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/1-Navigate-to-Settings.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/1-Navigate-to-Settings-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/1-Navigate-to-Settings-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;60px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/2-Save.jpg\" class=\"attachment-full size-full\" alt=\"Save\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/2-Save.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/2-Save-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/2-Save-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Afterward, revisit your site to check that no issues have appeared.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]However, in case you can\u2019t log in to your admin dashboard, you will have to try one of the more technical approaches to updating WordPress URLs. The same applies if you log in but the WordPress Address and Site Address fields are grayed out so you can\u2019t edit them.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/3-WordPress-Websites-URL.jpg\" class=\"attachment-full size-full\" alt=\"WordPress Websites URL\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/3-WordPress-Websites-URL.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/3-WordPress-Websites-URL-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/3-WordPress-Websites-URL-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;82px&#8221;][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"by-editing-the-wp-config-php-file\"><\/a>Change WordPress URLs by Editing the wp-config.php File<\/h3>\n<p>[\/vc_column_text][vc_column_text]You should try this method if you can\u2019t access the WordPress admin dashboard or if you are experiencing a <a href=\"https:\/\/qodeinteractive.com\/magazine\/wordpress-login-redirect-loop\">login redirection issue<\/a>. Also, if the fields for WordPress Address and Site Address are grayed out this can mean that the <strong>URLs are already hardcoded inside your wp-config.php file<\/strong>. Please note that this method requires you to work from within the wp-config.php file so <strong>you should have some basic technical knowledge or follow the instructions below carefully<\/strong>. You can edit the wp-config.php file either via FTP or using a control panel such as cPanel.[\/vc_column_text][vc_empty_space height=&#8221;23px&#8221;]<ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">Via FTP<\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_column_text]To edit the wp-config.php file, <strong>connect to your server<\/strong> using your FTP credentials and navigate to <strong>your root WordPress directory<\/strong>. Locate the wp-config.php file, right-click it and select the <strong>View\/Edit<\/strong> option from the dropdown menu.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/Wp-config-edit.jpg\" class=\"attachment-full size-full\" alt=\"WP Config Edit\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/Wp-config-edit.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/Wp-config-edit-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/Wp-config-edit-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Open the file<\/strong> using a text editor, find the line containing <strong>\/* That&#8217;s all, stop editing! Happy blogging. *\/<\/strong> and <strong>insert this code above<\/strong> it:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">define('WP_HOME','https:\/\/your-website.com');\r\ndefine('WP_SITEURL','https:\/\/your-website.com');<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;18px&#8221;][vc_column_text]Depending on the text editor you\u2019re using, the result should look something like this:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/4-text-editor.jpg\" class=\"attachment-full size-full\" alt=\"Text Editor\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/4-text-editor.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/4-text-editor-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/4-text-editor-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Don\u2019t forget to replace the <em>your-website<\/em> part with your actual website URL. If your URL contains www, don\u2019t forget to add that as well. <\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Afterward, <strong>save the changes<\/strong> and <strong>upload the edited file<\/strong> back to your server, overriding the current file.[\/vc_column_text][vc_empty_space height=&#8221;23px&#8221;]<ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">Via cPanel<\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_column_text]<strong>Connect to cPanel<\/strong> using your credentials and click on <strong>the File Manager option<\/strong> located near the top.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager.jpg\" class=\"attachment-full size-full\" alt=\"File Manager\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Navigate to <strong>your root WordPress directory<\/strong> (often called public_html) and locate the <strong>wp-config.php file<\/strong> within it. <strong>Right-click it<\/strong> and select <strong>the Edit option<\/strong> from the dropdown menu.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/cPanel-edit-wp-config.jpg\" class=\"attachment-full size-full\" alt=\"cPanel edit wp-config\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/cPanel-edit-wp-config.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/cPanel-edit-wp-config-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/03\/cPanel-edit-wp-config-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]The file will be opened in a new tab, using your default editor. As with FTP, find the \/* That&#8217;s all, stop editing! Happy blogging. *\/ line and <strong>insert this code<\/strong> above it:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">define('WP_HOME','https:\/\/your-website.com');\r\ndefine('WP_SITEURL','https:\/\/your-website.com');<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;18px&#8221;][vc_column_text]<strong>Make sure to replace the your-website part with your actual website URL. Also, make sure to add www, if your site URL contains it.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The result should look something like this:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/5-Replace-the-your-website-part.jpg\" class=\"attachment-full size-full\" alt=\"Replace the your website part\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/5-Replace-the-your-website-part.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/5-Replace-the-your-website-part-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/5-Replace-the-your-website-part-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]To finish, press <strong>the Save Changes button<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Afterward, make sure to revisit your site\u2019s frontend to check that everything is working properly.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;81px&#8221;][vc_separator color=&#8221;custom&#8221; accent_color=&#8221;#f0f0f0&#8243;][vc_empty_space height=&#8221;50px&#8221;][vc_widget_sidebar sidebar_id=&#8221;top-picks-banner&#8221;][vc_empty_space height=&#8221;28px&#8221;][vc_separator color=&#8221;custom&#8221; accent_color=&#8221;#f0f0f0&#8243;][vc_empty_space height=&#8221;84px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"by-editing-the-functions-php-file\"><\/a>Changing WordPress URLs by Editing the functions.php File<\/h3>\n<p>[\/vc_column_text][vc_column_text]This method is convenient when you are unable to log in to your admin dashboard. You can edit the WordPress URLs through the functions.php file of your theme. As an added benefit, once you\u2019ve inserted the code into your functions.php file, the URLs will automatically be changed in the database. We will show you how to edit the file using either an FTP or the cPanel.[\/vc_column_text][vc_empty_space height=&#8221;23px&#8221;]<ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">Via FTP<\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_column_text]<strong>Connect to your server<\/strong> using your FTP credentials and locate <strong>the root WordPress directory<\/strong>. Navigate to \/<strong>wp-content\/themes<\/strong> and click on <strong>your theme\u2019s directory<\/strong> (twentytwenty, in our case) to open it.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Find the <strong>functions.php file, right-click on it<\/strong> and select <strong>the View\/Edit<\/strong> option from the dropdown menu.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/7-functions.php-file.jpg\" class=\"attachment-full size-full\" alt=\"functions.php file\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/7-functions.php-file.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/7-functions.php-file-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/7-functions.php-file-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Open the file<\/strong> using a text editor and <strong>insert this code at the bottom<\/strong>:[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">update_option( 'siteurl', 'https:\/\/your-website.com' );\r\nupdate_option( 'home', 'https:\/\/your-website.com' );<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;39px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/8-code-at-the-bottom.jpg\" class=\"attachment-full size-full\" alt=\"Code at the bottom\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/8-code-at-the-bottom.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/8-code-at-the-bottom-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/8-code-at-the-bottom-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Replace the <em>your-website<\/em> part with your actual website URL. If your site has a www, make sure to add it as well.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;23px&#8221;]<ul class=\"qodef-unordered-list-item \">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\">Via cPanel<\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_column_text]<strong>Log in to cPanel<\/strong> using your credentials, navigate to <strong>the Files section<\/strong> near the top and click on<strong> the File Manager option<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager.jpg\" class=\"attachment-full size-full\" alt=\"File Manager\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/File-Manager-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then locate <strong>your root WordPress directory<\/strong> (public_html) and navigate to <strong>\/wp-content\/themes\/<\/strong> afterward. Click on <strong>the directory of your theme<\/strong> (twentytwenty, in our case) and locate the <strong>functions.php<\/strong> file within the directory. <strong>Right-click<\/strong> on the file and select <strong>the Edit option<\/strong> from the dropdown menu.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/9-locate-your-root-WordPress-directory.jpg\" class=\"attachment-full size-full\" alt=\"Locate your root WordPress directory\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/9-locate-your-root-WordPress-directory.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/9-locate-your-root-WordPress-directory-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/9-locate-your-root-WordPress-directory-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]The file will open in your default editor. <strong>Add the following code<\/strong> at the end of the file.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;][vc_column_text]<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">update_option( 'siteurl', 'https:\/\/your-website.com' );\r\nupdate_option( 'home', 'https:\/\/your-website.com' );<\/pre>\n<p>[\/vc_column_text][vc_empty_space height=&#8221;18px&#8221;][vc_column_text]<strong>Make sure to replace the your-website part with your actual website URL. If your site has a www, add it as well.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Afterward, click on <strong>the Save Changes button<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Then <strong>visit your site<\/strong> once more to see if everything is working. If it is, you can simply <strong>remove the two previously inserted lines of code<\/strong> as they\u2019ve done their job.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"by-editing-the-database\"><\/a>How to Change WordPress URL by Editing the Database<\/h3>\n<p>[\/vc_column_text][vc_column_text]The final method we are going to show you is changing WordPress URLs directly inside your database. <strong>Please note that this might break your site if done incorrectly<\/strong>. If you don\u2019t feel comfortable with doing this on your own, seek help from a developer.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Now, let\u2019s take a look at the way you can change the WordPress URLs in your database. First, you should be logged in to cPanel. Next, find the <strong>Databases<\/strong> section near the top and click on <strong>the phpMyAdmin option<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"378\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/phpMyAdmin.jpg\" class=\"attachment-full size-full\" alt=\"phpMyAdmin\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/phpMyAdmin.jpg 710w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/phpMyAdmin-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/02\/phpMyAdmin-620x330.jpg 620w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]A new page will open. Locate <strong>your database<\/strong> from the list on the left and <strong>click on it<\/strong>. Find <strong>the options table<\/strong> within and click on it. Keep in mind that the default prefix for WordPress databases is <strong>wp_<\/strong> so the table you\u2019re looking for will be listed as <strong>wp_options<\/strong>. However, if you\u2019ve set a custom prefix for your database, the table will be named <strong>yourprefixname_options<\/strong>. Now, the rows within that table will be shown in the central part of your screen. Under the column <em><strong>option_name<\/strong><\/em> you\u2019ll need to <strong>locate the two rows named siteurl and home<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/10-Locate-the-two-rows-named-siteurl-and-home.jpg\" class=\"attachment-full size-full\" alt=\"Locate the two rows named siteurl and home\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/10-Locate-the-two-rows-named-siteurl-and-home.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/10-Locate-the-two-rows-named-siteurl-and-home-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/10-Locate-the-two-rows-named-siteurl-and-home-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then, to <strong>modify the siteurl<\/strong>, click on <strong>the Edit option<\/strong> located at the beginning of that row.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/11-Modify-the-siteurl.jpg\" class=\"attachment-full size-full\" alt=\"Modify the siteurl\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/11-Modify-the-siteurl.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/11-Modify-the-siteurl-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/11-Modify-the-siteurl-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This will open a window where you can <strong>insert your siteurl<\/strong>. Find the <strong>Value<\/strong> column and add your new URL at the suggested spot. To finish, press <strong>the Go button<\/strong> at the edge of the window.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/Your-siteurl.jpg\" class=\"attachment-full size-full\" alt=\"Your siteurl\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/Your-siteurl.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/Your-siteurl-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/05\/Your-siteurl-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Edit your home URL in the same manner<\/strong>. Afterward, <strong>review your site frontend<\/strong> to make sure that everything is working properly.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Final Thoughts<\/h2>\n<p>[\/vc_column_text][vc_column_text]There are many situations when changing your WordPress site\u2019s URLs can come in handy. Some of the solutions we described may have seemed complicated before &#8211; after this tutorial, we hope you realized they are actually quite straightforward and take only minutes. This guide may prove to be helpful in numerous situations, so make sure you bookmark this article and keep it close if you need it again.[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Learn how to change WordPress URLs so your site can stay up to date when you switch to HTTPS, create subdirectories, or migrate to a different server.<\/p>\n","protected":false},"author":11229,"featured_media":7756,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[4,13],"class_list":["post-7149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-tips","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/7149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/11229"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=7149"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/7149\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/7756"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=7149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=7149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=7149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}