Step 3: Set up GitHub
We recommend creating a GitHub repository for each project you’re working on—a theme, a plugin, or a full site. You can create a free GitHub account and then set up as many public or private repositories as you like. Each repository gives you version control and can deploy to your WordPress.com production or staging site.
We recommend this development workflow for most projects. An alternative is WordPress Studio Sync, which syncs a complete WordPress.com site with a local WordPress Studio site in either direction, without GitHub. WordPress Studio Sync can also complement GitHub-based development workflows.
You can add your code to a GitHub repository from the command line or with a desktop app like GitHub Desktop. Whichever you use, GitHub’s guide to adding locally hosted code to GitHub covers creating and publishing the repository. The sections below cover what’s specific to WordPress.com: which folder becomes the repository, and what to leave out of it.
Create a GitHub repository for a theme or plugin
Give each theme or plugin its own repository, created from that theme’s or plugin’s folder, so the repository matches one folder on your WordPress.com site.
To set up the repository, take the following steps:
- Create a folder for your theme in
wp-content/themes/, or for your plugin inwp-content/plugins/. In a WordPress Studio site, these folders are inside your site folder, for example/Users/user_name/Studio/site_name/wp-content/themes. - Create a repository from that folder and publish it to GitHub by following GitHub’s guide to adding locally hosted code to GitHub. The repository can be public or private. Naming it after the folder makes it easier to match to your site later.
- Note the folder’s path on your site, such as
/wp-content/themes/theme_nameor/wp-content/plugins/plugin_name. You’ll enter it as the destination directory when you deploy in Step 5.
Once published, your repository and its code appear on GitHub.
Put your whole wp-content folder under version control with GitHub
To put a full site under version control, track the wp-content folder rather than the whole site. The wp-content folder holds your themes, plugins, and other customizations. WordPress core files stay unchanged and can be downloaded again at any time. The wp-config.php file sits outside wp-content, so it stays out of the repository. It holds your site’s WordPress configuration, which belongs to each site and isn’t something to deploy from GitHub.
To include your site’s database, use WordPress Studio Sync alongside this repository. WordPress Studio Sync does not provide version control.
First, you’ll need to create a local repository in your site wp-content folder:
- In WordPress Studio, select your site and click the Overview tab.
- In the Open in… section, open the site folder in your chosen code editor.
- Create a file named
.gitignoreinside thewp-contentfolder. - Add the following folder and file names to this new
.gitignorefile to avoid tracking them in your repository. This will exclude the plugins required by WordPress Studio, your SQLite database, and your uploads folder. For this reason, your posts, pages, and images from your local site won’t be committed to your repository or deployed to your production site.
mu-plugins
database
db.php
uploads- Create a repository from the
wp-contentfolder and publish it to GitHub by following GitHub’s guide to adding locally hosted code to GitHub. The repository can be public or private. - When you deploy in Step 5, set the destination directory to
/wp-content.
Once published, your repository and its code appear on GitHub.
With your repository on GitHub, continue to Step 4: Develop locally to make changes and commit them to it.
Last updated: December 01, 2026