{"id":613,"date":"2024-06-28T12:41:08","date_gmt":"2024-06-28T12:41:08","guid":{"rendered":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/?p=613"},"modified":"2024-06-28T12:42:08","modified_gmt":"2024-06-28T12:42:08","slug":"change-wordpress-website-domain-name","status":"publish","type":"post","link":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/change-wordpress-website-domain-name\/","title":{"rendered":"How To Change Your WordPress Website\u2019s Domain Name"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"wordpress-website-domain\">wordpress website domain<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-content\/uploads\/2024\/06\/2149406778-1024x683.jpg\" alt=\" WordPress Website Domain\" class=\"wp-image-615\" srcset=\"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-content\/uploads\/2024\/06\/2149406778-1024x683.jpg 1024w, https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-content\/uploads\/2024\/06\/2149406778-300x200.jpg 300w, https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-content\/uploads\/2024\/06\/2149406778-768x512.jpg 768w, https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-content\/uploads\/2024\/06\/2149406778.jpg 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#wordpress-website-domain\">wordpress website domain<\/a><ul><li><a href=\"#1-backup-your-website\">1. Backup Your Website<\/a><\/li><li><a href=\"#2-update-word-press-address-and-site-address\">2. Update WordPress Address and Site Address<\/a><\/li><li><a href=\"#3-update-the-wp-config-php-file\">3. Update the wp-config.php File<\/a><\/li><li><a href=\"#4-update-the-database\">4. Update the Database<\/a><\/li><li><a href=\"#5-update-links-and-images\">5. Update Links and Images<\/a><\/li><li><a href=\"#6-redirect-old-domain-to-new-domain\">6. Redirect Old Domain to New Domain<\/a><\/li><li><a href=\"#7-update-google-search-console-and-analytics\">7. Update Google Search Console and Analytics<\/a><\/li><li><a href=\"#8-update-social-media-and-other-external-links\">8. Update Social Media and Other External Links<\/a><\/li><li><a href=\"#9-verify-and-test\">9. Verify and Test<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/wordpress.com\/\" target=\"_blank\" rel=\"noopener\">wordpress<\/a> website domain Changing your website\u2019s domain name has advantages and disadvantages, but it\u2019s a decision that should be considered carefully, especially if you have an established WordPress site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Having said that, there are valid reasons for changing a domain name, and if the need arises, it\u2019s crucial to handle the process correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The good news is that changing the primary WordPress URL is quite simple. You\u2019ll need to adjust some WordPress settings in two different places, but both tasks are straightforward.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this post, we\u2019ll guide you through changing your existing domain name within WordPress, with essential tips to ensure a successful transition. Let\u2019s begin!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-backup-your-website\">1. Backup Your Website<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before making any changes, it\u2019s crucial to back up your website to avoid data loss.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Files:<\/strong> Use an FTP client or your<a href=\"https:\/\/www.webhostinghyderabad.co.in\/web-hosting\/\"> hosting<\/a> control panel to download all your website files.<\/li>\n\n\n\n<li><strong>Database:<\/strong> Export your database using phpMyAdmin or a backup plugin.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-update-word-press-address-and-site-address\">2. Update WordPress Address and Site Address<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to your WordPress admin dashboard.<\/li>\n\n\n\n<li>Navigate to <strong>Settings &gt; General<\/strong>.<\/li>\n\n\n\n<li>Update the <strong>WordPress Address (URL)<\/strong> and <strong>Site Address (URL)<\/strong> fields with your new domain name.<\/li>\n\n\n\n<li>Save the changes.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-update-the-wp-config-php-file\">3. Update the wp-config.php File<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure your new domain is correctly referenced, you can define it in your <code>wp-config.php<\/code> file.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Access your website files via FTP or your hosting control panel.<\/li>\n\n\n\n<li>Open the <code>wp-config.php<\/code> file.<\/li>\n\n\n\n<li>Add the following lines, replacing <code>https:\/\/newdomain.com<\/code> with your new domain:phpCopy code<code>define('WP_HOME', 'https:\/\/newdomain.com'); define('WP_SITEURL', 'https:\/\/newdomain.com');<\/code><\/li>\n\n\n\n<li>Save and upload the updated file.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-update-the-database\">4. Update the Database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To replace all instances of the old domain with the new one, you\u2019ll need to run a database search and replace.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Using a Plugin:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Install and activate a plugin like Better Search Replace or WP Migrate DB.<\/li>\n\n\n\n<li>Use the plugin to search for your old domain and replace it with the new domain.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Using phpMyAdmin:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Access phpMyAdmin via your hosting control panel.<\/li>\n\n\n\n<li>Select your WordPress database.<\/li>\n\n\n\n<li>Run the following SQL query, replacing <code>olddomain.com<\/code> and <code>newdomain.com<\/code> with your respective domains:sqlCopy code<code>UPDATE wp_options SET option_value = replace(option_value, 'http:\/\/olddomain.com', 'http:\/\/newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'http:\/\/olddomain.com','http:\/\/newdomain.com'); UPDATE wp_posts SET post_content = replace(post_content, 'http:\/\/olddomain.com', 'http:\/\/newdomain.com'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'http:\/\/olddomain.com','http:\/\/newdomain.com');<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"5-update-links-and-images\">5. Update Links and Images<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure all links and images reference the new domain, you may need to update them manually or use a plugin.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Plugins:<\/strong> Use the Better Search Replace plugin to search and replace URLs in your content and metadata.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"6-redirect-old-domain-to-new-domain\">6. Redirect Old Domain to New Domain<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Set up a 301 redirect from your old domain to your new domain to preserve SEO rankings and ensure visitors are directed to the new site.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Access your <code>.htaccess<\/code> file via FTP or your hosting control panel.<\/li>\n\n\n\n<li>Add the following code, replacing <code>olddomain.com<\/code> and <code>newdomain.com<\/code>:apacheCopy code<code>RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain\\.com [NC] RewriteRule ^(.*)$ http:\/\/newdomain.com\/$1 [L,R=301,NC]<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"7-update-google-search-console-and-analytics\">7. Update Google Search Console and Analytics<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Google Search Console:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Add the new domain as a new property.<\/li>\n\n\n\n<li>Use the Change of Address tool to notify Google of the domain change.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Google Analytics:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Update the property settings to reflect the new domain.<\/li>\n\n\n\n<li>If necessary, create a new property for the new domain.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"8-update-social-media-and-other-external-links\">8. Update Social Media and Other External Links<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Update your domain name on social media profiles, business listings, and any other platforms where your old domain was used.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"9-verify-and-test\">9. Verify and Test<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Verify:<\/strong> Ensure that all links, images, and references to the old domain are updated.<\/li>\n\n\n\n<li><strong>Test:<\/strong> Navigate through your site to ensure everything is working correctly and the new domain is fully operational.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">By following these steps, you can successfully change your WordPress website\u2019s domain name while minimizing downtime and maintaining SEO rankings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>wordpress website domain wordpress website domain Changing your website\u2019s domain name has advantages and disadvantages, but it\u2019s a decision that should be considered carefully, especially if you have an established WordPress site. Having said that, there are valid reasons for changing a domain name, and if the need arises, it\u2019s crucial to handle the process [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":614,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-website"],"_links":{"self":[{"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/posts\/613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/comments?post=613"}],"version-history":[{"count":1,"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/posts\/613\/revisions"}],"predecessor-version":[{"id":616,"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/posts\/613\/revisions\/616"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/media\/614"}],"wp:attachment":[{"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/media?parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/categories?post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhostinghyderabad.co.in\/tutorials\/wp-json\/wp\/v2\/tags?post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}