{"id":19613,"date":"2025-04-06T12:24:47","date_gmt":"2025-04-06T10:24:47","guid":{"rendered":"https:\/\/tremhost.com\/blog\/?p=19613"},"modified":"2025-04-06T12:24:47","modified_gmt":"2025-04-06T10:24:47","slug":"how-to-change-wordpress-site-url-site-address","status":"publish","type":"post","link":"https:\/\/tremhost.com\/blog\/how-to-change-wordpress-site-url-site-address\/","title":{"rendered":"How to change WordPress site URL (Site Address)"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p>When managing a WordPress website, you might find yourself needing to change the site URL or address. This could be due to a domain change, moving to a secure HTTPS protocol, or other reasons. Changing the WordPress URL is not overly complicated, but it needs to be done carefully to prevent any downtime or errors. In this guide, we will walk through the steps to safely change your WordPress site URL, along with tips for troubleshooting common issues that might arise during or after the change.<\/p>\n<h2>Step-by-Step Guide to Changing WordPress URL<\/h2>\n<ol>\n<li>\n<p><strong>Through WordPress Admin Dashboard:<\/strong><br \/>\nThe simplest way to change the site URL is through the WordPress admin dashboard. Go to <code>Settings<\/code> &gt; <code>General<\/code>. Here, you will find two fields: &#8216;WordPress Address (URL)&#8217; and &#8216;Site Address (URL)&#8217;. Enter the new URL in these fields and save the changes. This method is straightforward but requires that you can access your WordPress admin area.<\/p>\n<\/li>\n<li>\n<p><strong>Editing wp-config.php File:<\/strong><br \/>\nIf you have access to your site files, you can directly define the site URL in the <code>wp-config.php<\/code> file. This is particularly useful if you cannot access the WordPress dashboard. Add these two lines above the <code>\/* That's all, stop editing! Happy blogging. *\/<\/code> comment in <code>wp-config.php<\/code>:<\/p>\n<pre><code class=\"language-php\">define('WP_HOME','http:\/\/yournewurl.com');\ndefine('WP_SITEURL','http:\/\/yournewurl.com');<\/code><\/pre>\n<p>Replace <code>http:\/\/yournewurl.com<\/code> with your actual new URL.<\/p>\n<\/li>\n<li>\n<p><strong>Using functions.php File:<\/strong><br \/>\nAnother file-based method involves adding a couple of lines to the <code>functions.php<\/code> file of your active theme. Insert the following lines at the top:<\/p>\n<pre><code class=\"language-php\">update_option('siteurl', 'http:\/\/yournewurl.com' );\nupdate_option('home', 'http:\/\/yournewurl.com' );<\/code><\/pre>\n<p>As usual, replace <code>http:\/\/yournewurl.com<\/code> with your new URL. After loading your site once, these changes can be removed from <code>functions.php<\/code>.<\/p>\n<\/li>\n<\/ol>\n<h2>Troubleshooting Common Issues and Errors<\/h2>\n<ol>\n<li>\n<p><strong>Unable to Access WP-Admin:<\/strong><br \/>\nIf after changing the URL, you cannot access your admin panel, it&#8217;s often due to incorrect URLs in the settings. You can revert the changes by directly accessing your MySQL database using a tool like phpMyAdmin, and editing the <code>wp_options<\/code> table. Look for the <code>siteurl<\/code> and <code>home<\/code> entries and correct them if necessary.<\/p>\n<\/li>\n<li>\n<p><strong>Redirect Issues:<\/strong><br \/>\nIncorrect settings can lead to redirection loops or pages failing to load. Check your .htaccess file, which is in your root directory, for any custom redirects or rewrites that might conflict with your new URL settings. Resetting your permalinks through the WordPress admin (if accessible) by going to <code>Settings<\/code> &gt; <code>Permalinks<\/code> and hitting save can sometimes resolve these issues.<\/p>\n<\/li>\n<li>\n<p><strong>Mixed Content Errors After Moving to HTTPS:<\/strong><br \/>\nIf you&#8217;re changing to an HTTPS URL, you might face mixed content errors, where some resources are loaded over HTTP. To fix this, ensure all links in your database, theme, and plugins are using HTTPS. Plugins like &#8216;Really Simple SSL&#8217; can automate this process and help enforce SSL across your site.<\/p>\n<\/li>\n<\/ol>\n<p>Changing your WordPress site&#8217;s URL might seem daunting, but following these step-by-step instructions will make the process smoother. Whether you&#8217;re updating through the admin dashboard, editing core files, or directly in the database, it\u2019s important to back up your site before making changes. If problems arise, troubleshooting common issues like access errors or redirect problems can help restore your site&#8217;s functionality swiftly. With these guidelines, you should be well-equipped to handle the URL change efficiently and with confidence.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Changing Your WordPress Site URL: A Quick Guide<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-19613","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-general"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/comments?post=19613"}],"version-history":[{"count":1,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19613\/revisions"}],"predecessor-version":[{"id":19948,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19613\/revisions\/19948"}],"wp:attachment":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/media?parent=19613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/categories?post=19613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/tags?post=19613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}