How to Remove WWW From Website URL

This article is all about how to remove WWW from domain name URL. In this guide, I have mentioned how could you do it easily.

You all know that WWW is an abbreviation stands for World Wide Web. It is a complete set of documents and other web resources that are identified by Uniform Resource Locator (URLs), interlinked by hypertext links that use HTTP protocol.

In this article, I will cover following points:

  • Why we use WWW in URL?
  • Benefits of not having WWW in domain name URL.
  • How to Remove WWW from site URL?
  • Does it impact SEO?
  • How to set the Preferred Domain in Google Webmaster tools?

READ ON: Here is the Performance Optimization in an HTTP/2

So, let’s start.

Why We Use WWW in Domain Name URL?

All websites run on HTTP. Earlier it was essential to have WWW in URL to tell the browser to connect to the HTTP server. But now each browser run this protocol by default. Thus now, it is not necessary to have WWW as a prefix in website URL.

Benefits of not having WWW in domain URL:

  • The website can very well be loaded without it.
  • Branding, domains look nice and short.
  • Save visitors time, users will not have to write WWW each time they visit your site.
  • As I wrote above, all browsers have HTTP by default. Thus, if you directly search by domain, you will redirect you to the same site.

How To Remove WWW from Domain Name URL?

So, here is the main task starts.

  1. Remove WWW From URL (.htaccess):

To do so, you just need to add some lines of code in your .htaccess file.

Add the following mod_rewrite rule to your .htaccess file. While doing this, make sure you have enabled Apache’s mod_rewrite module.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

Now, whether user typing WWW while entering the domain name or not, the browser will show in both the cases as the code automatically removes WWW from URL.

2. Remove WWW From URL (Nginx):

In the case of Nginx, the snippet is different. But, if setting it properly in the proper configuration file, it will work fine.

server {
return 301$request_uri;

Now, restart Nginx and check if it’s working properly.

Thus, you have successfully removed WWW from your site URL. But here many queries arises. Let me cover them.

Does keeping or removing WWW impact SEO rankings?

You might have a question for using it or not will have an impact on your SEO. Well, the answer is NO. It just the matter of preference/esthetics.

But, I recommend making this bigger change at the beginning of your startup. Keep in mind that you are changing the URL. So, changing it later may harm your SEO rankings.

READ: 2017’s Five Most important Factors To Improve Ranking

Now, the question arises How?

Here is the answer:

All your backlinks which are pointing to the URL and the page rank both will be lost.

Huh, this is my situation, What to do?

Hey, don’t worry. There is also a solution over it.

You just need to set the preferred domain in Google Webmaster Tools. Then Google will automatically display your choice of the domain in the search results.

But How To Set Preferred Domain In Google Webmaster Tools?

  • Open Google Webmaster Tool.
  • Log in to your account.
  • Verify, your domain if you have not done it before. Also, verify the other version by the same process.
  • Go to Site configuration > Settings > General Settings.
  • Set your preferred domain. Google gives two options.
  • Display URLs as
  • Display URLs as Set Accordingly.
  • Save the changes.

READ: How To Add Your New Site To Google Webmaster Tools


As I mentioned earlier, you just need to change configurations. Do not worry about security and SEO rankings. Google Webmaster Tools will take care of all the SEO stuff. Also, read how to Clean Your Bad Backlink to keep your site SEO clean.

If you have any question, feel free to ask in the comment section below.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.


Please enter your comment!
Please enter your name here


Bluehost Hosting

Get hosting for just $3.95 per month with Bluehost. Bluehost is an officially recommend WordPress host, and one of the most popular & reliable web hosts available.


Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...


Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You...

How to Delete Multiple Images in WordPress Media Gallery

Hey, guys today one of my friends asked me a question, How can I delete Multiple Images in WordPress? I replied, "It's very simple." Yeah,...

How to setup CloudFlare CDN for WordPress blog

In today's world website speed is a crucial element to getting good ranks on the web. Website speed also aids in indexing...

How To Reduce Admin-Ajax Server Load In WordPress

To increase better user experience, we always end up by increasing site speed. After clicking a website link seems like a simple...

How to Remove jQuery Migrate in WordPress?

jQuery Migrate greatly simplifies the process of moving older jQuery code to a higher jQuery version by identifying deprecated features. It then restores deprecated...