{"id":648,"date":"2015-09-04T13:26:45","date_gmt":"2015-09-04T13:26:45","guid":{"rendered":"http:\/\/blog.mydiscover.in\/sms\/?page_id=648"},"modified":"2025-01-18T13:59:14","modified_gmt":"2025-01-18T13:59:14","slug":"changing-the-site-url","status":"publish","type":"page","link":"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/","title":{"rendered":"How to change WordPress domain  Changing The Site URL"},"content":{"rendered":"\n<p>How to Change the WordPress Address (URL) and Site Address (URL): A Complete Guide<\/p>\n\n\n\n<p>Managing your WordPress site effectively often involves adjusting critical settings like the <strong>WordPress Address (URL)<\/strong> and <strong>Site Address (URL)<\/strong>. These fields, found under <strong>Settings &gt; General<\/strong> in a single-site WordPress installation, define where WordPress identifies your site and how URLs are displayed in the admin dashboard and frontend.<\/p>\n\n\n\n<p>Understanding these settings is vital for site functionality and user accessibility. Below, we explain their purposes and provide actionable steps to update them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WordPress Address (URL) vs. Site Address (URL)<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>WordPress Address (URL):<\/strong> Specifies the location of your WordPress core files.<\/li>\n\n\n\n<li><strong>Site Address (URL):<\/strong> Determines the URL users enter to access your website.<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udca1 <strong>Pro Tip:<\/strong> Both URLs should start with <code>http:\/\/<\/code> or <code>https:\/\/<\/code> and should not include a trailing slash (<code>\/<\/code>).<\/p>\n\n\n\n<p>Occasionally, incorrect URL settings can cause your site to malfunction, leaving users unable to access it. This guide outlines methods to resolve such issues, move WordPress sites, and ensure seamless updates.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Methods to Change WordPress URLs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Edit <code>wp-config.php<\/code><\/strong><\/h3>\n\n\n\n<p>Manually defining URLs in the <code>wp-config.php<\/code> file is a quick fix:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">phpCopyEdit<code>define('WP_HOME', 'http:\/\/example.com');\ndefine('WP_SITEURL', 'http:\/\/example.com');\n<\/code><\/pre>\n\n\n\n<p><strong>Note:<\/strong> This approach hardcodes the values, preventing future edits through the WordPress admin panel.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>Edit <code>functions.php<\/code><\/strong><\/h3>\n\n\n\n<p>If you can access your site via FTP, you can modify the <code>functions.php<\/code> file to restore functionality:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the active theme&#8217;s <code>functions.php<\/code> file in a text editor.<\/li>\n\n\n\n<li>Add the following lines after <code>&lt;?php<\/code>:phpCopyEdit<code>update_option('siteurl', 'http:\/\/example.com'); update_option('home', 'http:\/\/example.com');<\/code><\/li>\n\n\n\n<li>Save and upload the file. Reload your admin page to verify the changes.<\/li>\n\n\n\n<li><strong>Important:<\/strong> Remove these lines after resolving the issue to prevent unwanted behavior.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Change URLs via phpMyAdmin<\/strong><\/h3>\n\n\n\n<p>If you&#8217;re familiar with database management, you can update URLs directly in your WordPress database:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to phpMyAdmin and select your WordPress database.<\/li>\n\n\n\n<li>Navigate to the <code>wp_options<\/code> table.<\/li>\n\n\n\n<li>Locate and edit the <code>siteurl<\/code> and <code>home<\/code> fields, replacing them with your new URLs.<\/li>\n\n\n\n<li>Save changes and refresh your site.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>Using the Relocate Method<\/strong><\/h3>\n\n\n\n<p>For quick site relocation:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add the following line to <code>wp-config.php<\/code>:phpCopyEdit<code>define('RELOCATE', true);<\/code><\/li>\n\n\n\n<li>Log in to <code>wp-login.php<\/code> on your new server.<\/li>\n\n\n\n<li>Update the settings under <strong>Settings > General<\/strong>.<\/li>\n\n\n\n<li>Remove or comment out the <code>RELOCATE<\/code> line in <code>wp-config.php<\/code> after completing the changes.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Moving WordPress to a New Domain<\/h2>\n\n\n\n<p>When transferring WordPress to a new domain or server, ensure the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Update hardcoded URLs in theme files (<code>sidebar.php<\/code>, <code>footer.php<\/code>, etc.).<\/li>\n\n\n\n<li>Search and replace old URLs in the database using tools like <strong>WP-CLI<\/strong>:bashCopyEdit<code>wp search-replace 'http:\/\/oldsite.com' 'http:\/\/newsite.com' --skip-columns=guid<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Additional Tips for URL Management<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Media Links:<\/strong> Update media URLs in the <code>post_content<\/code> column of the database if the upload folder changes.<\/li>\n\n\n\n<li><strong>GUID Caution:<\/strong> Never edit the <code>GUID<\/code> field in the <code>wp_posts<\/code> table\u2014it ensures feed integrity.<\/li>\n\n\n\n<li><strong>Permalinks:<\/strong> After URL changes, update your <code>.htaccess<\/code> file to ensure permalinks function correctly.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting and Best Practices<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Backup First:<\/strong> Always create backups of your database and files before making changes.<\/li>\n\n\n\n<li><strong>Check Plugins:<\/strong> Some plugins store URL references. Update these settings manually if needed.<\/li>\n\n\n\n<li><strong>Test Your Changes:<\/strong> Verify that all links, media, and redirects work as expected.<\/li>\n<\/ol>\n\n\n\n<p>By following these steps, you can confidently manage WordPress URLs, recover a broken site, or move your website to a new location without complications.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">FAQs<\/h3>\n\n\n\n<p><strong>1. Why should I avoid leaving the <code>RELOCATE<\/code> constant in <code>wp-config.php<\/code>?<\/strong><br>Leaving <code>RELOCATE<\/code> enabled can expose your site to security risks, allowing attackers to change your URL.<\/p>\n\n\n\n<p><strong>2. How do I update multiple URLs in a multisite setup?<\/strong><br>Multisite configurations require careful adjustments in multiple tables. Tools like <strong>WP-CLI<\/strong> simplify this process:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">bashCopyEdit<code>wp search-replace 'http:\/\/oldsite.com' 'http:\/\/newsite.com'\n<\/code><\/pre>\n\n\n\n<p><strong>3. Can I edit URLs through the WordPress admin dashboard?<\/strong><br>Yes, under <strong>Settings &gt; General<\/strong>, but this requires a functioning site.<\/p>\n\n\n\n<p>Mastering URL management in WordPress ensures smooth operation and enhances user experience. Bookmark this guide for future reference!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Change the WordPress Address (URL) and Site Address (URL): A Complete Guide Managing your WordPress site effectively often involves adjusting critical settings like the WordPress Address (URL) and Site Address (URL). These fields, found under Settings &gt; General in a single-site WordPress installation, define where WordPress identifies your site and how URLs are <\/p>\n<div class=\"read-more-text\"><a href=\"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/\" class=\"read-more\">continue reading<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-648","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to change WordPress domain Changing The Site URL - My Discover<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to change WordPress domain Changing The Site URL - My Discover\" \/>\n<meta property=\"og:description\" content=\"How to Change the WordPress Address (URL) and Site Address (URL): A Complete Guide Managing your WordPress site effectively often involves adjusting critical settings like the WordPress Address (URL) and Site Address (URL). These fields, found under Settings &gt; General in a single-site WordPress installation, define where WordPress identifies your site and how URLs are continue reading\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/\" \/>\n<meta property=\"og:site_name\" content=\"My Discover\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-18T13:59:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/changing-the-site-url\\\/\",\"url\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/changing-the-site-url\\\/\",\"name\":\"How to change WordPress domain Changing The Site URL - My Discover\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/#website\"},\"datePublished\":\"2015-09-04T13:26:45+00:00\",\"dateModified\":\"2025-01-18T13:59:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/changing-the-site-url\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/changing-the-site-url\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/changing-the-site-url\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to change WordPress domain Changing The Site URL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/\",\"name\":\"My Discover\",\"description\":\"Uncover New Possibilities\",\"publisher\":{\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/#\\\/schema\\\/person\\\/642f364af2ec34384ea1dd5227cf1ec9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/#\\\/schema\\\/person\\\/642f364af2ec34384ea1dd5227cf1ec9\",\"name\":\"admin\",\"logo\":{\"@id\":\"https:\\\/\\\/mydiscover.net.in\\\/blog\\\/#\\\/schema\\\/person\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to change WordPress domain Changing The Site URL - My Discover","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/","og_locale":"en_US","og_type":"article","og_title":"How to change WordPress domain Changing The Site URL - My Discover","og_description":"How to Change the WordPress Address (URL) and Site Address (URL): A Complete Guide Managing your WordPress site effectively often involves adjusting critical settings like the WordPress Address (URL) and Site Address (URL). These fields, found under Settings &gt; General in a single-site WordPress installation, define where WordPress identifies your site and how URLs are continue reading","og_url":"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/","og_site_name":"My Discover","article_modified_time":"2025-01-18T13:59:14+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/","url":"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/","name":"How to change WordPress domain Changing The Site URL - My Discover","isPartOf":{"@id":"https:\/\/mydiscover.net.in\/blog\/#website"},"datePublished":"2015-09-04T13:26:45+00:00","dateModified":"2025-01-18T13:59:14+00:00","breadcrumb":{"@id":"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/mydiscover.net.in\/blog\/changing-the-site-url\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mydiscover.net.in\/blog\/"},{"@type":"ListItem","position":2,"name":"How to change WordPress domain Changing The Site URL"}]},{"@type":"WebSite","@id":"https:\/\/mydiscover.net.in\/blog\/#website","url":"https:\/\/mydiscover.net.in\/blog\/","name":"My Discover","description":"Uncover New Possibilities","publisher":{"@id":"https:\/\/mydiscover.net.in\/blog\/#\/schema\/person\/642f364af2ec34384ea1dd5227cf1ec9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mydiscover.net.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/mydiscover.net.in\/blog\/#\/schema\/person\/642f364af2ec34384ea1dd5227cf1ec9","name":"admin","logo":{"@id":"https:\/\/mydiscover.net.in\/blog\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/pages\/648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/comments?post=648"}],"version-history":[{"count":3,"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/pages\/648\/revisions"}],"predecessor-version":[{"id":12863,"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/pages\/648\/revisions\/12863"}],"wp:attachment":[{"href":"https:\/\/mydiscover.net.in\/blog\/wp-json\/wp\/v2\/media?parent=648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}