PHPackages                             tinacms/wp-gatsby-markdown-exporter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tinacms/wp-gatsby-markdown-exporter

AbandonedArchivedWordpress-plugin[Parsing &amp; Serialization](/categories/parsing)

tinacms/wp-gatsby-markdown-exporter
===================================

Export WordPress content to Markdown for GatsbyJS.

v0.3.4(6y ago)4674[5 issues](https://github.com/tinacms/wp-gatsby-markdown-exporter/issues)[1 PRs](https://github.com/tinacms/wp-gatsby-markdown-exporter/pulls)GPL-3.0-or-laterPHP

Since Dec 9Pushed 5y ago2 watchersCompare

[ Source](https://github.com/tinacms/wp-gatsby-markdown-exporter)[ Packagist](https://packagist.org/packages/tinacms/wp-gatsby-markdown-exporter)[ RSS](/packages/tinacms-wp-gatsby-markdown-exporter/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (8)Versions (10)Used By (0)

WP Gatsby Markdown Exporter
===========================

[](#wp-gatsby-markdown-exporter)

A command line WordPress plugin to export WordPress content to Markdown for use with [GatsbyJS](https://www.gatsbyjs.org/).

Want to build real-time editing into your Gatsby site? Checkout [TinaCMS](https://tinacms.org/)!

[![travis ci build status](https://camo.githubusercontent.com/0ac7c0f240327040a923c4b920efc5f2ada9a638bd1d57faf4620a1c1f9b37dd/68747470733a2f2f7472617669732d63692e6f72672f74696e61636d732f77702d6761747362792d6d61726b646f776e2d6578706f727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tinacms/wp-gatsby-markdown-exporter)

[![WordPress to Gatsby Exporter and TinaCMS](docs/wp-gatsby-markdown-exporter-tina.jpg)](docs/wp-gatsby-markdown-exporter-tina.jpg)

Features
--------

[](#features)

- Move WordPress content to Gatsby-friendly Markdown.
- Customize the export! Remap and restructure exported fields.
- CLI: Avoid PHP timeouts by using the command line with WP-CLI.
- CLI: Export progress bar (great for large sites)!

Usage
-----

[](#usage)

1. Download plugin and enable it, then click "Export to Gatsby" from the WordPress admin sidebar.
2. Submit the form to download a zip file with exported content.
3. Place the unzipped files in the content directory of the Markdown based site.

> Reminder: always keep a backup of the WordPress database and files in case your export doesn't work as expected!

Checkout the [WP-CLI command](#command-line-usage) to run the export from your command line to avoid PHP timeouts!

Installation Methods (choose one)
---------------------------------

[](#installation-methods-choose-one)

### Download zip file (Easiest)

[](#download-zip-file-easiest)

Download the [latest release](https://github.com/tinacms/wp-gatsby-markdown-exporter/releases/latest/download/wp-gatsby-markdown-exporter.zip) and unzip the file into wp-content/plugins.

### Composer require

[](#composer-require)

Make sure you have [Composer installed](https://getcomposer.org/doc/00-intro.md) and navigate to the WordPress site directory, then:

```
composer require tinacms/wp-gatsby-markdown-exporter

```

### Git clone + Composer

[](#git-clone--composer)

Or clone this repository into wp-content/plugins, then navigate to the `wp-gatsby-markdown-exporter` directory:

```
composer install

```

Enable the plugin
-----------------

[](#enable-the-plugin)

Activate "WordPress to Gatsby Exporter" from the WordPress admin. Or from the plugin's directory:

```
wp plugin activate wp-gatsby-markdown-exporter

```

Working with Gatsby
-------------------

[](#working-with-gatsby)

If you're just getting started with Gatsby, we recommend experimenting with a Markdown based Gatsby starter like [Tina Grande](https://github.com/tinacms/tina-starter-grande). Installation is as easy as:

```
git clone https://github.com/tinacms/tina-starter-grande.git

cd tina-starter-grande

yarn install && gatsby develop

```

Then copy your exported WordPress Markdown into the `content` directory or point the wp gatsby-markdown-export command at the content directory.

Want to port your WordPress or HTML theme to Gatsby? Checkout [Porting an HTML Site to Gatsby](https://www.gatsbyjs.org/docs/porting-an-html-site-to-gatsby/) for tips.

Command Line Usage
------------------

[](#command-line-usage)

The command line functionality uses WP-CLI to interact with WordPress. [WP-CLI is easy to install](https://wp-cli.org/#installing) if you haven't already.

Once it's installed, you can export content to a directory like this:

```
wp gatsby-markdown-export --directory=/example/gatsby-starter/src/content

```

All CLI arguments are optional.

OptionDescriptionDefault value`--help`get help`--directory=`export output directoryrandom temp directory`--post_types=`post types to export, see: [https://developer.wordpress.org/reference/classes/wp\_query/#post-type-parameters](https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters)page,post`--post_status=`post status to export, see: [https://developer.wordpress.org/reference/classes/wp\_query/#status-parameters](https://developer.wordpress.org/reference/classes/wp_query/#status-parameters)any`--fields_to_markdown=`fields to convert to Markdownexcerpt`--excluded_front_matter=`fields to exclude from front matter`--post_date_format=`format for post publish date, see: c`--upload_dir=`directory in the export to copy WordPress uploadsuploads`--remap_fields=`remap front matter field names, example: find1,replace1;find2,replace2`--fields_to_array=`convert single value front matter fields to arrays`--include_private_fields=`private post meta fields to include (they start with \_)`--skip_copy_uploads`flag, skips copying WordPress uploads to the export`--skip_original_images`flag, skips the use of original dimension images`--skip_enforce_charset`flag, skips use of blog\_charset for the XML charset`--create_type_directory`flag, creates directories based on post typeHooks
-----

[](#hooks)

The following hooks can be implemented in a plugin to modify the behaviour of the exporter:

HookNotes`gatsby_markdown_exporter_posts`array of the post ids to be exported`gatsby_markdown_exporter_query_options`array of query options for the posts to be exported database query`gatsby_markdown_exporter_post_html_body`string of the post's HTML body`gatsby_markdown_exporter_post_converted_body`string of the post's body after conversion to Markdown`gatsby_markdown_exporter_post_meta`array of the post's meta fields that will become front matter fieldsRoadmap
-------

[](#roadmap)

- Add a how-to video.
- More/better unit tests.
- Allow for partial/resumable export.

Troubleshooting
---------------

[](#troubleshooting)

What does `Warning: The markdown converter encountered invalid HTML and could not convert the content at:` mean?

This means that the markdown converter couldn't convert the referenced post to markdown, so we will just copy the HTML as it is.

Acknowledgments
---------------

[](#acknowledgments)

The structure for this plugin was heavily influenced by Ben Balter's excellent [WordPress to Jekyll Exporter](https://github.com/benbalter/wordpress-to-jekyll-exporter).

License
-------

[](#license)

This project is licensed under the GPLv3 License - see the [LICENSE](https://github.com/tinacms/wp-gatsby-markdown-exporter/blob/master/LICENSE) file for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

9

Last Release

2308d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd1fb561c86299678f3114526d06294615b5408f8d3fb3ff53057d4308c87d09?d=identicon)[mitchmac](/maintainers/mitchmac)

---

Tags

wordpressmarkdowngatsby

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tinacms-wp-gatsby-markdown-exporter/health.svg)

```
[![Health](https://phpackages.com/badges/tinacms-wp-gatsby-markdown-exporter/health.svg)](https://phpackages.com/packages/tinacms-wp-gatsby-markdown-exporter)
```

###  Alternatives

[wpreadme2markdown/wpreadme2markdown

Convert WordPress Plugin readme.txt to Markdown

9564.6k4](/packages/wpreadme2markdown-wpreadme2markdown)[spatie/laravel-markdown-response

Serve markdown versions of your HTML pages to AI agents and bots

6512.6k](/packages/spatie-laravel-markdown-response)[wpreadme2markdown/wp2md

CLI tool for converting WordPress Plugin readme.txt to Markdown

1961.7k4](/packages/wpreadme2markdown-wp2md)[dudo1985/wpdocgen

Documentation Generator for WordPress.

2327.6k](/packages/dudo1985-wpdocgen)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
