Docs

Local development

Local sites are free and need no connection. What to do with a staging copy of the live database.

3 min read WordPress 6.6+ Updated 1 Dec 2026

Local sites are free

Edits on these hosts are never counted, whether the site is connected or not:

  • localhost and 127.0.0.1
  • *.ddev.site, *.lndo.site and *.docksal.site
  • *.test
  • *.local and *.localhost, which LocalWP, DevKinsta and WordPress Studio use

The toolbar shows a Dev badge there, so you can tell at a glance, and W-Pencil › Account says "This is a local development site: edits here are free and not counted." Ports don't matter. Connecting a local site is optional: it only adds it to your dashboard. No connect notice nags you on a local site.

Copies of the live database

wp db export, migration plugins and host staging tools copy the site's connection along with everything else, so a staging copy could spend the live site's edits. W-Pencil remembers the address it was connected from. On any other host that isn't a local one, it stops counting and tells admins:

This site looks like a copy of example.org, so editing here doesn't use its edits.

Editing still works on the copy. To tidy up, run this on the copy:

Terminal
$ wp w-pencil disconnect --local
Success: Disconnected on this site only. The site it was copied from stays connected.

It forgets the connection on the copy only. The live site stays connected, and its key keeps working. From then on the copy is a site of its own: connect it if editors use it. Connect separately in the notice does that in one go.

On a copy, always add --local. A copy has the same key as the live site. When W-Pencil sees the site is a copy, a plain disconnect only forgets the connection there. But a copy on a local host, like *.ddev.site or *.local, isn't treated as a copy, and WP-CLI on a server where the copy's home is still the live address can't tell either. In both cases a plain wp w-pencil disconnect tells W-Pencil to stop accepting the key, and the live site is disconnected too. On a local copy, so does Disconnect on W-Pencil › Account, unless you tick On this site only.

Trying credits on a local site

To see the credit chip and the out-of-credits panel on a local site, meter it like a live one in wp-config.php:

PHP
define( 'W_PENCIL_FORCE_METERING', true );

Or set the environment variable of the same name, as Docker and hosting panels do. Edits are then counted, and they come out of the connected account's edits. Remove it when you're done.

A local copy of w-pencil.cloud

Only if you work on W-Pencil itself: W_PENCIL_CLOUD_URL points the plugin at another cloud, like http://w-pencil.ddev.site:33001. It's read on local hosts only, so a live site always talks to https://w-pencil.cloud. wp-config constants lists both.

Next in Editors

The toolbar and keys.

What the toolbar shows, how to move from item to item and every key W-Pencil answers to.