╦ ╦╔═╗ ╔╦╗╔╦╗
║║║╠═╝───║║║ ║║
╚╩╝╩ ╩ ╩═╩╝
Create & edit remote WordPress content as markdown files locally.
Turn your WordPress site into a local folder of markdown files. Edit pages, posts, patterns, templates, and WooCommerce products with your favorite editor or AI coding assistant and sync back to remote site with changes.
# Install
curl -fsSL https://raw.githubusercontent.com/tomtev/wp-md/main/install.sh | bash
# Go to your project folder (where you want the markdown files)
cd your-project
# Connect to your WordPress site
wp-md init
# Pull all content from WordPress
wp-md pull
# Edit files locally, then push changes back
wp-md push- Node.js 18+
- WordPress site with REST API enabled
- Application Password for authentication
| Command | Description |
|---|---|
wp-md init [folder] |
Configure WordPress connection |
wp-md pull |
Download content from WordPress |
wp-md push |
Upload local changes to WordPress |
wp-md status |
Show sync status |
wp-md watch |
Watch for changes and auto-sync |
wp-md new <type> <title> |
Create new content |
wp-md upload <file> |
Upload media file |
wp-md force-push |
Push all content (creates missing) |
All commands support -d, --dir <directory> to specify a content directory.
wp-md watch # Watch current directory
wp-md watch -d site-a # Watch specific site
wp-md watch --all # Watch all sites in folder
wp-md watch --server # Start WebSocket server for browser extension
wp-md watch --all -s # Watch all sites + WebSocketyour-site/
├── .env # WordPress credentials
├── posts/ # Blog posts
├── pages/ # Pages
├── navigations/ # Navigation menus
├── templates/ # FSE templates
├── template-parts/ # Header, footer, etc.
├── patterns/ # Reusable patterns
├── media/ # Media metadata
├── taxonomies/ # Categories and tags
├── woocommerce/
│ ├── products/ # Products with variations
│ ├── categories/
│ ├── tags/
│ └── brands/
└── theme/
├── settings-color.md
├── settings-typography.md
└── styles-blocks.md
Files use YAML frontmatter + Gutenberg block markup:
---
id: 123
type: page
slug: about-us
status: publish
title: About Us
---
<!-- wp:heading {"level":1} -->
<h1>About Us</h1>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Content here using Gutenberg blocks.</p>
<!-- /wp:paragraph -->Variable products include attributes and variations in the frontmatter:
---
id: 456
type: product
title: T-Shirt
product_type: variable
regular_price: "29.99"
sku: TSHIRT-001
attributes:
- name: Size
options: [Small, Medium, Large]
variation: true
variations:
- id: 457
sku: TSHIRT-SM
regular_price: "29.99"
attributes:
- name: Size
option: Small
- id: 458
sku: TSHIRT-MD
regular_price: "29.99"
attributes:
- name: Size
option: Medium
---Add new variations by adding entries without id and running wp-md push.
# Quick install
curl -fsSL https://raw.githubusercontent.com/tomtev/wp-md/main/install.sh | bash
# Or manual install
git clone https://github.com/tomtev/wp-md.git
cd wp-md && npm install && npm linkcurl -fsSL https://raw.githubusercontent.com/tomtev/wp-md/main/uninstall.sh | bashwp-md uses WordPress Application Passwords:
- Go to WordPress Admin → Users → Profile
- Scroll to Application Passwords
- Enter a name (e.g., "wp-md") and click Add New
- Copy the generated password
- Use it during
wp-md init
wp-md init creates a .env file with your credentials:
# .env
WP_MD_URL=https://your-site.com
WP_MD_USER=your-username
WP_MD_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx| Variable | Description |
|---|---|
WP_MD_URL |
Your WordPress site URL |
WP_MD_USER |
WordPress username (admin) |
WP_MD_APP_PASSWORD |
Application password from WordPress |
Note: Add .env to your .gitignore to protect credentials.
Manage multiple WordPress sites in one project folder:
# Initialize each site in its own folder
wp-md init site-a
wp-md init site-b
# Pull/push with -d flag
wp-md pull -d site-a
wp-md push -d site-b
# Or cd into the folder
cd site-a && wp-md pullEach folder contains its own .env and content:
project/
site-a/
.env # Site A credentials
post-types/
templates/
theme/
site-b/
.env # Site B credentials
post-types/
...
When you run wp-md init, it creates instructions for AI coding assistants:
- Claude Code:
.claude/skills/wp-md/SKILL.md(skill) - Cursor & others:
content/AGENTS.md
These files teach AI assistants how to work with WordPress content, including Gutenberg block syntax and wp-md commands.
MIT