GC Git Updater self-updates
Lightweight WordPress plugin that updates themes from a GitHub repository. Public + private repos, single file, no dependencies.
by George Cook · github.com/georgehcook/gc-git-updater · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/georgehcook/gc-git-updater/archive/refs/heads/main.zipShips its own WordPress updater (built-in updater), so new versions show up under Dashboard → Updates.
A lightweight WordPress plugin that lets WordPress update an installed theme directly from a GitHub repository. Single file, no external dependencies, no composer.
Supports public and private repos. Updates appear in Dashboard → Updates alongside core/plugin/theme updates from wordpress.org.
How it works
- Reads
Version:from the active theme'sstyle.css. - Reads
GitHub Theme URI:from the same file (custom header registered by this plugin). - Polls
api.github.com(cached for 12 hours) for the remotestyle.cssand compares versions. - When the remote version is higher, WordPress shows an update. Clicking it downloads the GitHub zipball, extracts it, and renames the folder back to the theme slug.
Install
As a regular plugin
- Download or clone this repo.
- Drop
gc-git-updater/into/wp-content/plugins/on the target site. - Activate from Plugins.
As a must-use plugin (force-active, no UI to deactivate)
- Copy just
gc-git-updater.phpinto/wp-content/mu-plugins/. Create the directory if it does not exist. - Done. mu-plugins are auto-loaded.
Set up a theme to be updatable
Add this header to the theme's style.css:
/*
Theme Name: Your Theme
Version: 1.0.0
GitHub Theme URI: https://github.com/your-org/your-theme
*/
When you ship a release, bump Version: in style.css and push to the main branch (or tag a release). The next update check picks it up.
Note: this updater pulls from the
mainbranch zipball. If you build assets in CI, make sure the built files are committed to that branch.
Private repos: providing a token
Pick one:
| Method | Where | Notes |
|---|---|---|
| Constant | wp-config.php: define( 'GITHUB_ACCESS_TOKEN', 'ghp_xxx' ); |
Highest priority. Recommended for production. |
| Settings page | Settings → Git Updater | Stored in wp_options, fine for staging. |
| Filter | add_filter( 'simple_git_updater_token', fn() => 'ghp_xxx' ); |
For programmatic injection (e.g. from a secrets manager). |
Token scopes: repo for private repos, public_repo for public.
Settings page
Settings → Git Updater gives you:
- Status of the active theme (slug, version, configured repo)
- Override fields for repo URL and access token
- A Check for Updates button that bypasses cache and runs a live diagnostic API call, showing the exact HTTP response from GitHub. Useful for debugging "why isn't my update showing?"
Troubleshooting
- No update showing: hit the "Check for Updates" button on the settings page. It shows the raw HTTP response from GitHub.
- HTTP 404:
GitHub Theme URIis wrong, or the repo is private and your token doesn't have access. - HTTP 401/403: token missing, expired, or wrong scope.
- Update downloads but theme breaks: built assets (e.g.
dist/) aren't committed to the branch this plugin pulls from.
Notes on the class name
Internally the class is Simple_Git_Theme_Updater and the filter is simple_git_updater_token. These names are intentional, kept the same as the file-include version that previously lived inside themes, so any existing site using that pattern can migrate to this plugin without code changes.
License
MIT