Mapping Your Domain and Managing DNS

You love your shiny new WordPress.com site and you probably want to put your own domain on it.

To proceed forward, you’ll need to have first registered your domain with a domain registrar. If you haven’t yet, you can register your domain through WordPress.com or another domain registrar. To map a domain you already own, simply follow these instructions. Domain mappings are included for free on WordPress.com VIP and Enterprise.

Since DNS propagation can take up to 72 hours, you will want to begin this process at least a week before your planned launch date.

Managing DNS Records

Once you point your domain to WordPress nameservers, you can continue to manage your domain with our Domain Management tools which allow you to add custom DNS records.

If you map a 2nd-level domain (e.g. example.com), you can easily add a subdomain (e.g. vip.example.com) to it.

There are a few kinds of DNS changes that you cannot make directly through our tools, but that can be requested by contacting us via a ticket:

  • Adding wildcard DNS records
  • Adding TXT records that exceed 192 characters in length
  • Changing TTL values for DNS records
  • Adding TXT records for subdomains
  • Managing NS records for a domain

Mapping to WordPress.com

If your site will live on a 2nd-level domain (example.com), we highly recommend hosting it with our DNS servers. In order to smoothly handle any volume of traffic and weather any malicious attack, our load balancing and high availability solutions are dependent on us being the name server for 2nd-level domains. By taking this approach, it enables our skilled systems team to effectively route traffic to additional servers, mitigate attacks, or accommodate for an outage in one of our data centers.

If you have an existing website that you are migrating to WordPress.com, the following steps should be taken to set up the domain least a week before the launch:

  1. Send us the ZONE file for your domain including any subdomains or MX records for email.
  2. We will set up the domain mapping on the WordPress.com site
  3. We will set up the DNS entries to mirror your current setup (so your existing site continues to work when you point your domain to our nameservers).
  4. Once setup is complete, you can verify and switch to our nameservers.
  5. When your site is ready to launch, we will update your website’s entry to point to your new WordPress.com site.

This provides the most fluid migration and means we’re around to pull the actual trigger and assist with any post-launch tasks.

Using WordPress.com Nameservers

The nameservers to use are:

ns1.wordpress.com
ns2.wordpress.com
ns3.wordpress.com

We provide a handy DNS management tool for you to create A, MX, CNAME, and TXT records.

Using 3rd-party Nameservers

If you’re required to host the DNS elsewhere, you can create A records pointing to two or more of our IPs. To get this information, please contact us using the contact form inside your Dashboard.

At least a couple of days before the migration you will want to change the TTL to 300, or if that is not allowed by your current DNS hosting, the lowest value allowed to allow for the smoothest transition possible.

Subdomain (sub.example.com)

If your site will live on a subdomain (sub.example.com, all that is required is a CNAME. When the site is ready to launch, you can create a CNAME entry pointing to your registered WordPress.com site:

sub.example.com IN CNAME subexample.wordpress.com.

Note that you will want to change the TTL for the subdomain to 300 or the next lowest value allowed to make the transition as smooth as possible.

Primary Domains

Every WordPress.com site can have multiple mapped domains but only one Primary Domain. This the canonical domain name for your site and all other domains registered against the site will redirect accordingly. The Primary Domain can be set from the Domains page in the WordPress.com Dashboard; just head to Settings > Domains and select the domain you would like to be primary.

www subdomain

WordPress.com does not support using the www subdomain as a primary hostname for a site. The www subdomain is typically set up as a CNAME to the root domain, and requests to it are then redirected to the root domain.

Subdirectories

WordPress.com does not support hosting the root of a site in the subdirectory of a site’s primary domain.

DNSSEC

WordPress.com DNS does not currently support DNSSEC. If managing your DNS on WordPress.com you’ll need to disable DNSSEC at your registrar.

WordPress.com vs. WordPress.org

WordPress is a publishing platform that makes it easy for anyone to publish online, and proudly powers millions of websites. It comes in two flavors: the fully hosted WordPress.com, and the self-hosted version available at WordPress.org. You can read more about the general differences between the two.

There are a few key differences to keep in mind when developing a theme or plugin for a WordPress.com site compared to how you might do it for self-hosted/WordPress.org sites. We’ve outlined a non-exhaustive list below.

Caching

WordPress.com provides full page caching, along with persistent object caching, out of the box. Anonymous page views are retrieved from memory for high performance and high scalability, and many db queries and other code-level objects are stored in-memory for fast retrieval. For more information, see our caching documentation.

Comments

WordPress.com has a custom comment form that allows visitors to leave comments as guests or using their WordPress.com, Facebook, or Twitter accounts. This comment form is also available for self-hosted sites via Jetpack.

Core WordPress.com features

While WordPress.com is running on trunk WordPress, we’ve added a lot of bells and whistles in the form of features for every WordPress.com user and site owner. For more information about WordPress.com core features, take a read through the WordPress.com features category in the VIP Lobby and the WordPress.com features on the main WordPress.com Support site.

Custom Database Tables

Custom database tables are not supported on WordPress.com. You should try to work within the WordPress API and use existing storage mechanisms like Custom Post Types, Taxonomies, Post Meta/Custom Fields, and so on.

Custom Fields Meta Box

For security reasons, the “Custom Fields” meta box is disabled on WordPress.com. If your theme makes use of post meta, you should add custom meta boxes to allow users to enter data. The bonus is that this makes for a better user experience.

PHP File Whitelist

WordPress.com has a PHP file whitelist, which restricts direct access to PHP files that are not core WordPress files. This means that PHP files in your theme cannot be accessed directly, which goes against best practices anyway.

Plugins

Plugins on WordPress.com VIP are organized differently than a standard self-hosted/WordPress.org site, since on VIP your access is specific to your site’s theme folder. To use plugins on a WordPress.com VIP site, you add them to a “plugins” directory within your theme directory, and require_once/include_once them in functions.php.

Registering Users

By default, users registered through VIP-hosted websites are created as WordPress.com users and must go through the WordPress.com user registration process and agree to the WordPress.com terms of service. This means that the millions of users logged in to WordPress.com will also be logged in on your domain, making it easier for them to comment on your site. If you’d like to be able to register your own user profiles or create custom registration fields you’ll need to use a 3rd-party registration service, such as our partners at Janrain. Note that you can invite any existing WordPress.com user to join your site at any permitted user level.

Server-side Cookie Handling

Because of full-page caching, cookies should not be accessed or manipulated server-side. Any cookie handling code should be done client-side.

Textdomains

For translations, WordPress.com uses the “default” textdomain and your theme should too.

Toolbar

All logged-in users will see the WordPress.com admin bar. This cannot be removed as it is integral to the user experience on WordPress.com.

URL Functions

In your VIP theme and plugins, home_url() always returns the custom domain as mapped in WordPress.com whereas site_url() returns the *.wordpress.com domain.

Admin-ajax on domain-mapped sites

If your site uses a custom domain (and not just the default *.wordpress.com one) and your theme or plugin makes requests to admin-ajax.php, you’ll need to follow these instructions to make sure your requests are successful. This extra step is necessary because your site’s backend is served at a different domain than the front of your site.

Fetching remote data

On WordPress.com VIP, we provide special cached functions for fetching external data, and require that you use these, rather than the normal WordPress.org functions. Full details on how to use these functions are here.

Storing user data

User data storage works only slightly differently on WordPress.com VIP than on WordPress.org. The basic difference is that WordPress.org’s use of the user_meta is replaced by user_attributes. From a coding perspective the two behave exactly the same and and are set and accessed through the same functions. The one difference is that unique keys are required for user_attributes. Full details are here.

Embedding Rich Media

WordPress.com VIP takes particular care to protect your site and data from malicious code embedded in your site or content. When compared to WordPress.org, on WordPress.com VIP provides additional access to additional tools in the form of shortcodes and other protections that will keep you safe when you need to embed object, iframe and script tags. Please read the full documentation on embedding content.

Custom fields

The custom fields UI isn’t supported on WordPress.com. Please create your own custom meta boxes instead.

Introduction to WordPress.com VIP

Welcome to VIP Documentation!

WordPress.com VIP is the team at WordPress.com that works with high-profile websites. As a part of VIP, you get all of the features that WordPress.com offers, plus customizations and a team of WordPress experts reviewing your code. By being a part of WordPress.com — the world’s largest WordPress installation with tens of millions of sites and billions of page views – you get bulletproof security and enterprise-level scaling. You can learn more about our services here.

First things first. You should already have access to our private VIP Lobby. Please make sure to subscribe to receive important updates by email.

The process from the kickoff call, through theme review, to final launch of your site is described in our Launch Checklist.

If you have any questions, please contact us by using the VIP Support form inside your VIP Dashboard.

Ready to get started?

Tell us about your needs

Let us lead the way. We’ll help you select a top tier development partner. We’ll train your developers, operations, infrastructure, and editorial teams. We’ll coarchitect your deployment processes. We will provide live support for peak events. We’ll help your people avoid dark alleys and blind corners, and reduce wasted cycles.