{"id":7145,"date":"2017-02-06T16:11:22","date_gmt":"2017-02-06T16:11:22","guid":{"rendered":"http:\/\/hostileblog.com\/?p=4290"},"modified":"2020-05-30T21:35:41","modified_gmt":"2020-05-31T01:35:41","slug":"set-preferred-domain-google","status":"publish","type":"post","link":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/","title":{"rendered":"How to set preferred domain correctly in Google Search Console"},"content":{"rendered":"\n

Setting a preferred domain is one of the most important things to do after launching a new site. It takes few seconds to set a PD. Before setting a preferred domain, you should make sure that Google<\/span> indexes only the URLS<\/span> which you want to appear in search results. To do so, you must set up a 301 redirect.<\/p>\n\n\n\n

A 301 redirect will prevent duplicate content<\/span> issues. It will tell search engines that they should index the correct web pages.<\/p>\n\n\n\n

Webmasters should make sure that the following variants of their domain redirect with HTTP<\/span> status code 301 to one which they want to set as preferred.<\/p>\n\n\n\n

WWW only, HTTP<\/span> only, HTTP<\/span>+WWW<\/p>\n\n\n\n

If you don’t configure the 301 redirects correctly, Google<\/span> and other search engines will crawl and index non-WWW as well the WWW version of your website<\/span> and they’ll be confused to rank your website pages in search results<\/a>.<\/p>\n\n\n\n

After entering the redirect<\/span> rule in the Nginx or Apache<\/span> configuration file<\/span>, test your website URLS using the CURL command<\/a> or with redirect<\/span> checker tools.<\/p>\n\n\n\n

\"preferred<\/figure><\/div>\n\n\n\n

If you’ve enabled SSL<\/span> on your website<\/span>, you should configure the web server<\/span> to listen to HTTP<\/span> requests on port 80 and HTTPS<\/span> requests on port 443.<\/p>\n\n\n\n

If the web server<\/span> has received a request for an HTTP<\/span> URL<\/span>, it should serve the HTTPS<\/span> URL<\/span>.<\/p>\n\n\n\n

Preferred domain www or non-www which is better?<\/h2>\n\n\n\n

Frankly speaking, unless your server<\/span> configuration is incorrect or you’re allowing search engines to index thin and useless pages on your site<\/a>, you won’t see any difference in the ranking of WWW or non-www URLs<\/span>.<\/p>\n\n\n\n

How to set preferred domain in GSC?<\/h3>\n\n\n\n

Before you set up the preferred version<\/span> of your site, GSC will ask you to verify the website<\/span>.<\/p>\n\n\n\n

Verifying a website<\/span> is easy. All you have to do is add the Google Analytics<\/a> code to the head or footer section of the site or place the HTML<\/span> code provided by the search console to the website<\/span>‘s header section.<\/p>\n\n\n\n

Once GSC verifies the ownership of the website<\/span>, open the settings interface in Google Search Console<\/a> and select one option from the list. Once you set preferred version<\/span> of your site, you must make Google<\/span> aware of the location of your sitemap file<\/span>. To do so, click on the crawl option in the Google<\/span> Search Console interface and select the sitemap option<\/p>\n\n\n\n

Enter the name of the sitemap file<\/span> in the text box you find on the page<\/span> and click on submit button. Once you’ve submitted a valid sitemap file<\/a>, Google<\/span> will index the URL<\/span> for the preferred version<\/span> of the website<\/span>.<\/p>\n","protected":false},"excerpt":{"rendered":"

Setting a preferred domain is one of the most important things to do after launching a new site. It takes few seconds to set a PD. Before setting a preferred domain, you should make sure that Google indexes only the URLS which you want to appear in search results. To do so, you must set […]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[11413,128,7051],"post_series":[],"yoast_head":"\nHow to set preferred domain correctly in Google Search Console - Ian Carnaghan<\/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:\/\/www.carnaghan.com\/set-preferred-domain-google\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to set preferred domain correctly in Google Search Console - Ian Carnaghan\" \/>\n<meta property=\"og:description\" content=\"Setting a preferred domain is one of the most important things to do after launching a new site. It takes few seconds to set a PD. Before setting a preferred domain, you should make sure that Google indexes only the URLS which you want to appear in search results. To do so, you must set […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/\" \/>\n<meta property=\"og:site_name\" content=\"Ian Carnaghan\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-06T16:11:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-31T01:35:41+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg\" \/>\n<meta name=\"author\" content=\"Pramod\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@icarnaghan\" \/>\n<meta name=\"twitter:site\" content=\"@icarnaghan\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pramod\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/\"},\"author\":{\"name\":\"Pramod\",\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/f52a97a0d4f7b309922ab0381d337bbb\"},\"headline\":\"How to set preferred domain correctly in Google Search Console\",\"datePublished\":\"2017-02-06T16:11:22+00:00\",\"dateModified\":\"2020-05-31T01:35:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/\"},\"wordCount\":436,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/c689c24d516c51968a88b628860740a5\"},\"image\":{\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg\",\"keywords\":[\"Affiliate\",\"Google\",\"Tips\"],\"articleSection\":[\"Coding\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/\",\"url\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/\",\"name\":\"How to set preferred domain correctly in Google Search Console - Ian Carnaghan\",\"isPartOf\":{\"@id\":\"https:\/\/www.carnaghan.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg\",\"datePublished\":\"2017-02-06T16:11:22+00:00\",\"dateModified\":\"2020-05-31T01:35:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage\",\"url\":\"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg\",\"contentUrl\":\"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.carnaghan.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to set preferred domain correctly in Google Search Console\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.carnaghan.com\/#website\",\"url\":\"https:\/\/www.carnaghan.com\/\",\"name\":\"Ian Carnaghan\",\"description\":\"Software Developer, Blogger, Educator\",\"publisher\":{\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/c689c24d516c51968a88b628860740a5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.carnaghan.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/c689c24d516c51968a88b628860740a5\",\"name\":\"Ian Carnaghan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f2aa5baca80c2be728de43a975185d91?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f2aa5baca80c2be728de43a975185d91?s=96&d=retro&r=g\",\"caption\":\"Ian Carnaghan\"},\"logo\":{\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/image\/\"},\"description\":\"I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.\",\"sameAs\":[\"http:\/\/www.carnaghan.com\",\"https:\/\/x.com\/icarnaghan\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/f52a97a0d4f7b309922ab0381d337bbb\",\"name\":\"Pramod\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.carnaghan.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9b9cc255f2495f5394b801428d7d6929?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9b9cc255f2495f5394b801428d7d6929?s=96&d=retro&r=g\",\"caption\":\"Pramod\"},\"description\":\"My name is Pramod. I\u2019m a software developer (with good knowledge on PHP, JAVA \u2013 Android, JavaScript, CSS), blogger and online marketing professional. I\u2019ve 3 years of experience as a blogger and 2 years of full time experience as a software developer.\",\"url\":\"https:\/\/www.carnaghan.com\/author\/prhost78\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to set preferred domain correctly in Google Search Console - Ian Carnaghan","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:\/\/www.carnaghan.com\/set-preferred-domain-google\/","og_locale":"en_US","og_type":"article","og_title":"How to set preferred domain correctly in Google Search Console - Ian Carnaghan","og_description":"Setting a preferred domain is one of the most important things to do after launching a new site. It takes few seconds to set a PD. Before setting a preferred domain, you should make sure that Google indexes only the URLS which you want to appear in search results. To do so, you must set […]","og_url":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/","og_site_name":"Ian Carnaghan","article_published_time":"2017-02-06T16:11:22+00:00","article_modified_time":"2020-05-31T01:35:41+00:00","og_image":[{"url":"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg"}],"author":"Pramod","twitter_card":"summary_large_image","twitter_creator":"@icarnaghan","twitter_site":"@icarnaghan","twitter_misc":{"Written by":"Pramod","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#article","isPartOf":{"@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/"},"author":{"name":"Pramod","@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/f52a97a0d4f7b309922ab0381d337bbb"},"headline":"How to set preferred domain correctly in Google Search Console","datePublished":"2017-02-06T16:11:22+00:00","dateModified":"2020-05-31T01:35:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/"},"wordCount":436,"commentCount":0,"publisher":{"@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/c689c24d516c51968a88b628860740a5"},"image":{"@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage"},"thumbnailUrl":"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg","keywords":["Affiliate","Google","Tips"],"articleSection":["Coding"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/","url":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/","name":"How to set preferred domain correctly in Google Search Console - Ian Carnaghan","isPartOf":{"@id":"https:\/\/www.carnaghan.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage"},"image":{"@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage"},"thumbnailUrl":"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg","datePublished":"2017-02-06T16:11:22+00:00","dateModified":"2020-05-31T01:35:41+00:00","breadcrumb":{"@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.carnaghan.com\/set-preferred-domain-google\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#primaryimage","url":"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg","contentUrl":"http:\/\/www.carnaghan.com\/wp-content\/uploads\/2017\/02\/preferred-domain.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.carnaghan.com\/set-preferred-domain-google\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.carnaghan.com\/"},{"@type":"ListItem","position":2,"name":"How to set preferred domain correctly in Google Search Console"}]},{"@type":"WebSite","@id":"https:\/\/www.carnaghan.com\/#website","url":"https:\/\/www.carnaghan.com\/","name":"Ian Carnaghan","description":"Software Developer, Blogger, Educator","publisher":{"@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/c689c24d516c51968a88b628860740a5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.carnaghan.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/c689c24d516c51968a88b628860740a5","name":"Ian Carnaghan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f2aa5baca80c2be728de43a975185d91?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f2aa5baca80c2be728de43a975185d91?s=96&d=retro&r=g","caption":"Ian Carnaghan"},"logo":{"@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/image\/"},"description":"I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment.","sameAs":["http:\/\/www.carnaghan.com","https:\/\/x.com\/icarnaghan"]},{"@type":"Person","@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/f52a97a0d4f7b309922ab0381d337bbb","name":"Pramod","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.carnaghan.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9b9cc255f2495f5394b801428d7d6929?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9b9cc255f2495f5394b801428d7d6929?s=96&d=retro&r=g","caption":"Pramod"},"description":"My name is Pramod. I\u2019m a software developer (with good knowledge on PHP, JAVA \u2013 Android, JavaScript, CSS), blogger and online marketing professional. I\u2019ve 3 years of experience as a blogger and 2 years of full time experience as a software developer.","url":"https:\/\/www.carnaghan.com\/author\/prhost78\/"}]}},"views":173,"_links":{"self":[{"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/posts\/7145"}],"collection":[{"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/comments?post=7145"}],"version-history":[{"count":0,"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/posts\/7145\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/media?parent=7145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/categories?post=7145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/tags?post=7145"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/www.carnaghan.com\/wp-json\/wp\/v2\/post_series?post=7145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}