Static Site Exporter

Por Ben Balter
(12 avaliações)
Baixar
  • Versão:
    4.5.0
  • Última atualização:
    há 2 dias
  • Instalações ativas:
    mais de 400
  • Versão do WordPress:
    6.4 ou maior
  • Testado até o WordPress:
    7.1.4
  • Versão do PHP:
    8.2 ou maior
  • Tags:

Hospedagem WordPress com plugin Static Site Exporter

Onde devo hospedar o plugin Static Site Exporter?

Este plugin pode ser hospedado em qualquer hospedagem que possua WordPress configurado. Recomendamos fortemente escolher uma hospedagem seguro, com servidores adaptados para WordPress, como o serviço de hospedagem de sites da MCO2.

Hospedando o plugin Static Site Exporter em um provedor seguro

A MCO2, além de configurar e instalar o WordPress na versão mais atualizada para seus clientes, fornece o plugin WP SafePress, um mecanismo singular que protege e melhora seu site conjuntamente.

Por que a Hospedagem WordPress funciona melhor na MCO2?

A Hospedagem WordPress funciona melhor pois a MCO2 possui servidores otimizados para WordPress. A instalação de WordPress é diferente de uma instalação trivial, pois habilita imediatamente recursos como otimização de imagens, proteção da página de login, bloqueio de atividades suspeitas diretamente no firewall, cache avançado e HTTPS ativado por padrão. São plugins que potencializam seu WordPress para a máxima segurança e o máximo desempenho.

One-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Jekyll (or Hugo or any other Markdown and YAML based site engine).

funcionalidades

  • Converts all posts, pages, and settings from WordPress to Markdown and YAML for use in Jekyll (or Hugo or any other Markdown and YAML based site engine)
  • Export what your users see, not what the database stores (runs post content through the_content filter prior to export, allowing third-party plugins to modify the output)
  • Converts all post_content to Markdown
  • Converts all post_meta and fields within the wp_posts table to YAML front matter for parsing by Jekyll
  • Generates a _config.yml with all settings in the wp_options table
  • Outputs a single zip file with _config.yml, pages, and _posts folder containing .md files for each post in the proper Jekyll naming convention
  • Selective export: Export only specific categories, tags, or post types using WP-CLI
  • No settings. Just a single click.

Uso

  1. In your WordPress dashboard, go to Plugins Add New, search for Static Site Exporter, then install and activate it
  2. Select Export to Jekyll from the Tools menu
  3. Unzip the download into your static site

For large sites, use WP-CLI instead: wp jekyll-export --output=export.zip.

More information

See the full documentation:

Selective Export by Category or Tag

This feature allows you to export only a specific subset of your WordPress content, filtered by category, tag, or post type. This is particularly useful when:

  • You have a large WordPress site but only need to convert specific sections
  • You want to migrate content by topic or category
  • You need to export content incrementally

Using WP-CLI

The easiest way to perform selective exports is via WP-CLI commands.

Export by Category

To export posts from a single category, use the category slug:

wp jekyll-export --category=technology > technology-export.zip

To export from multiple categories (OR logic – posts in any of these categories):

wp jekyll-export --category=tech,news,updates > export.zip

Export by Tag

To export posts with a specific tag:

wp jekyll-export --tag=featured > featured-export.zip

To export posts with multiple tags (OR logic):

wp jekyll-export --tag=featured,popular > export.zip

Export Specific Post Types

To export only pages:

wp jekyll-export --post_type=page > pages-export.zip

To export only posts:

wp jekyll-export --post_type=post > posts-export.zip

To export custom post types:

wp jekyll-export --post_type=portfolio,testimonial > custom-export.zip

Combining Filters

You can combine multiple filters. Posts must match ALL specified filters (AND logic):

# Export posts that are in "technology" category AND have "featured" tag
wp jekyll-export --category=technology --tag=featured --post_type=post > export.zip<h3>Using PHP Filters</h3>

For more programmatic control, you can use WordPress filters directly in your theme’s functions.php or a custom plugin.

Filter by Category

add_filter( 'jekyll_export_taxonomy_filters', function() {
    return array(
        'category' => array( 'technology', 'science' ),
    );
} );

Filter by Tag

add_filter( 'jekyll_export_taxonomy_filters', function() {
    return array(
        'post_tag' => array( 'featured', 'popular' ),
    );
} );

Filter by Custom Taxonomy

add_filter( 'jekyll_export_taxonomy_filters', function() {
    return array(
        'my_custom_taxonomy' => array( 'term-slug-1', 'term-slug-2' ),
    );
} );

Combine Multiple Taxonomies

add_filter( 'jekyll_export_taxonomy_filters', function() {
    return array(
        'category' => array( 'technology' ),
        'post_tag' => array( 'featured' ),
        'custom_tax' => array( 'term-1' ),
    );
} );

Filter Post Types

add_filter( 'jekyll_export_post_types', function() {
    return array( 'post', 'page' ); // Only export posts and pages
} );<h3>Finding Category and Tag Slugs</h3>

If you’re not sure what slug to use:

Via WordPress Admin

  1. Go to Posts > Categories or Posts > Tags
  2. Hover over the category/tag name
  3. Look at the browser’s status bar or the URL – you’ll see something like tag_ID=123&taxonomy=post_tag&term_slug=featured
  4. The slug is the part after term_slug=

Via WP-CLI

List all categories with their slugs:

wp term list category --fields=name,slug

List all tags with their slugs:

wp term list post_tag --fields=name,slug<h3>Use Cases</h3>

Scenario 1: Export a Single Blog Section

You have a WordPress site with multiple sections (Tech, Lifestyle, Travel) and want to move just the Tech section to a static site:

wp jekyll-export --category=tech > tech-blog-export.zip

Scenario 2: Export Featured Content

You want to export only posts marked as “featured” for a special showcase site:

wp jekyll-export --tag=featured > featured-content.zip

Scenario 3: Export by Year (using custom taxonomy)

If you’ve tagged posts by year, you can export by year:

wp jekyll-export --tag=2024 > 2024-posts.zip

Scenario 4: Migrate Content Incrementally

Export different categories separately for incremental migration:

wp jekyll-export --category=tech > tech.zip
wp jekyll-export --category=news > news.zip
wp jekyll-export --category=reviews > reviews.zip<h3>Technical Details</h3>

– Taxonomy Filtering: Uses WordPress term slugs (not names or IDs)
– Query Performance: Filtering is done at the database level for efficiency
– OR Logic Within Taxonomy: Multiple terms in the same taxonomy use OR logic (e.g., posts in category A OR B)
– AND Logic Across Taxonomies: Multiple taxonomies use AND logic (e.g., posts in category A AND having tag B)
– Post Type Filtering: Works independently of taxonomy filtering

Limitations

  • Revisions are excluded when using taxonomy filters (as they don’t have taxonomy terms)
  • Taxonomy filtering uses term slugs, not term IDs or names
  • Empty taxonomy filters are ignored (no filtering applied)

Troubleshooting

No Posts Exported

If your export is empty:

  1. Check the slug: Make sure you’re using the term slug, not the name
    • Use wp term list category to verify the exact slug
  2. Check post status: Only published, future, and draft posts are exported
  3. Verify taxonomy: Make sure you’re using the correct taxonomy name (category, post_tag, etc.)

Wrong Posts Exported

If you’re getting unexpected posts:

  1. Check term associations: Verify which posts have the category/tag assigned
  2. Review filter logic: Remember that multiple categories use OR logic
  3. Clear cache: If testing, use wp cache flush between exports

Tipos de post personalizados

To export custom post types, add a filter (e.g., in your theme’s functions.php) like this:

add_filter( 'jekyll_export_post_types', function() {
    return array('post', 'page', 'your-custom-post-type');
});

Each custom post type is exported as a Jekyll collection: posts of type portfolio go in _portfolios/, and the exported _config.yml declares that collection with output: true, so Jekyll builds a page for each one.

Custom fields

When using custom fields (e.g. with the Advanced Custom fields plugin) you might have to register a filter to convert array style configs to plain values.

Available Filters

The plugin provides two filters for customizing post metadata:

  • jekyll_export_meta: Filters the metadata for a single post before it’s merged with taxonomy terms. Receives $meta array and $post object as parameters.
  • jekyll_export_post_meta: Filters the complete metadata array (including taxonomy terms) just before it’s written to the YAML frontmatter. Receives $meta array and $post object as parameters. This is the recommended filter for most use cases.

Note: As of the latest version, the plugin no longer automatically removes empty or falsy values from the frontmatter. All metadata is preserved by default. If you want to remove certain fields, you can use the jekyll_export_post_meta filter to customize this behavior.

By default, the plugin saves custom fields in an array structure that is exported as:

["my-bool"]=>
    array(1) {
        [0] => string(1) "1"
    }
["location"]=>
    array(1) {
        [0] => string(88) "My address"
    }

And this leads to a YAML structure like:

my-bool:
- "1"
location:
- 'My address'

This is likely not the structure you expect or want to work with. You can convert it using a filter:

add_filter( 'jekyll_export_meta', function($meta) {
    foreach ($meta as $key => $value) {
        if (is_array($value) && count($value) === 1 && array_key_exists(0, $value)) {
            $meta[$key] = $value[0];
        }
    }

    return $meta;
});

A more complete solution could look like that:

add_filter( 'jekyll_export_meta', function($meta) {
    foreach ($meta as $key => $value) {
        // Advanced Custom Fields
        if (is_array($value) && count($value) === 1 && array_key_exists(0, $value)) {
            $value = maybe_unserialize($value[0]);
            // Advanced Custom Fields: NextGEN Gallery Field add-on
            if (is_array($value) && count($value) === 1 && array_key_exists(0, $value)) {
                $value = $value[0];
            }
        }
        // convert types
        $value = match ($key) {
            // Advanced Custom Fields: "true_false" type
            'my-bool' => (bool) $value,
            default => $value
        };
        $meta[$key] = $value;
    }

    return $meta;
});

Removing Empty or Falsy Values

If you want to remove empty or falsy values from the frontmatter (similar to the pre-3.0.3 behavior), you can use the jekyll_export_post_meta filter:

add_filter( 'jekyll_export_post_meta', function( $meta, $post ) {
    foreach ( $meta as $key => $value ) {
        // Remove falsy values except numeric 0
        if ( ! is_numeric( $value ) && ! $value ) {
            unset( $meta[ $key ] );
        }
    }
    return $meta;
}, 10, 2 );<h3>Command-line Usage</h3>

If you’re having trouble with your web server timing out before the export is complete, or if you just like terminal better, you may enjoy the command-line tool.

It works just like the plugin, but produces the zipfile on STDOUT:

php jekyll-export-cli.php > jekyll-export.zip

If using this method, you must run first cd into the wordpress-to-jekyll-exporter directory.

Alternatively, if you have WP-CLI installed, you can run:

wp jekyll-export > export.zip

The WP-CLI version will provide greater compatibility for alternate WordPress environments, such as when wp-content isn’t in the usual location.

To write the zip straight to a file instead of STDOUT, pass --output. This keeps a stray PHP notice or warning from ending up inside the archive:

wp jekyll-export --output=export.zip

To leave out drafts and other unpublished content, pass the statuses you want with --post_status:

wp jekyll-export --post_status=publish > export.zip

If your media is served from a CDN, or the uploads folder is too big to zip, pass --skip-uploads to export without wp-content/uploads:

wp jekyll-export --skip-uploads > export.zip<h3>Filtering by Category or Tag</h3>

You can export only specific categories or tags using the WP-CLI command. This is useful when you want to convert just one section of your WordPress site instead of the entire corpus.

Export posts from a specific category:

wp jekyll-export --category=technology > export.zip

Export posts from multiple categories:

wp jekyll-export --category=tech,news,updates > export.zip

Export posts with a specific tag:

wp jekyll-export --tag=featured > export.zip

Export only pages (or specific post types):

wp jekyll-export --post_type=page > export.zip

Combine filters:

wp jekyll-export --category=technology --tag=featured --post_type=post > export.zip<h3>Using Filters in PHP</h3>

If you’re using the plugin via PHP code or want more control, you can use the jekyll_export_taxonomy_filters filter:

add_filter( 'jekyll_export_taxonomy_filters', function() {
    return array(
        'category' => array( 'technology', 'science' ),
        'post_tag' => array( 'featured' ),
    );
} );

// Then trigger the export
global $jekyll_export;
$jekyll_export->export();<h3>Performance Tips for Large Sites</h3>

If you’re running a large WordPress site with thousands of posts or gigabytes of uploads, here are some tips to make the export process faster and more efficient.

Quick Wins

1. Use WP-CLI Instead of Browser Export

Browser-based exports are subject to PHP execution time limits (typically 30-300 seconds). Use WP-CLI for unlimited execution time:

wp jekyll-export > export.zip

2. Skip Uploads if You Don’t Need Them

If your images and files are served from a CDN or you plan to handle them separately, you can skip the uploads directory entirely:

// Add to your theme's functions.php or a custom plugin
add_filter( 'jekyll_export_skip_uploads', '__return_true' );

This can save significant time and disk space, especially if you have gigabytes of media files.

3. Exclude Cache and Temporary Directories

Many sites accumulate cache files and temporary uploads that aren’t needed in the export:

add_filter( 'jekyll_export_excluded_upload_dirs', function( $excluded ) {
    return array_merge( $excluded, array(
        '/cache/',
        '/tmp/',
        '/backup/',
        '/wc-logs/',  // WooCommerce logs
        '/wpml/',     // WPML cache
    ) );
} );<h3>Performance Improvements in Version 2.4.3+</h3>

Recent optimizations have significantly improved export speed:

  • 67% fewer database queries when fetching posts
  • 95% fewer database queries for author information (on sites with multiple authors)
  • 40-60% faster overall for typical WordPress sites

Still Having Timeout Issues?

If exports are still timing out, try these solutions:

Increase PHP Memory and Time Limits

Add to your wp-config.php:

define( 'WP_MEMORY_LIMIT', '512M' );
@ini_set( 'max_execution_time', '600' ); // 10 minutes

Export Only Specific Post Types

If you only need posts (not pages or other custom post types):

add_filter( 'jekyll_export_post_types', function() {
    return array( 'post' ); // Only export posts
} );

Run Export During Off-Peak Hours

Schedule the export using WP-CLI and cron during low-traffic periods:

# Add to crontab to run at 3 AM
0 3 * * 0 cd /path/to/wordpress && wp jekyll-export > /path/to/backups/jekyll-$(date +\%Y\%m\%d).zip<h3>Measuring Performance</h3>

To see how long your export takes:

Via WP-CLI with Timing

time wp jekyll-export > export.zip

Via PHP Script

$start = microtime(true);
// ... run export ...
$duration = microtime(true) - $start;
error_log("Export completed in " . round($duration, 2) . " seconds");

Via the `jekyll_export_complete` action

jekyll_export_complete fires once after a successful export, after the archive has been sent or saved and temporary files have been cleaned up. It does not fire when the export fails. Output echoed by a callback is discarded.

add_action( 'jekyll_export', function() {
    update_option( 'jekyll_export_start_time', microtime( true ) );
} );

add_action( 'jekyll_export_complete', function() {
    $start = get_option( 'jekyll_export_start_time' );
    if ( $start ) {
        $duration = microtime( true ) - $start;
        error_log( sprintf( 'Jekyll export completed in %.2f seconds', $duration ) );
        delete_option( 'jekyll_export_start_time' );
    }
} );<h3>Database Optimization</h3>

Before exporting, optimize your database:

wp db optimize

This can improve query performance during the export process.

Hardware Recommendations

For very large sites (10,000+ posts), consider:

  • SSD storage for faster file I/O
  • At least 2GB RAM for PHP
  • Modern PHP version (7.4+ or 8.0+) for better performance

Troubleshooting Slow Exports

If exports are still slow after optimizations:

  1. Check slow query log: Identify if specific database queries are bottlenecks
  2. Profile plugin conflicts: Disable other plugins temporarily to isolate issues
  3. Monitor server resources: Check if CPU/memory/disk I/O is maxed out
  4. Consider hosting: Shared hosting may have strict resource limits

Getting Help

If you’re still experiencing performance issues:

  1. Measure your baseline: How many posts? How large is wp_uploads?
  2. Check error logs: Look for PHP errors or warnings
  3. Open an issue: Report on GitHub with details

Include in your report:
– Number of posts/pages
– Size of uploads directory
– PHP version and memory limit
– Export duration or timeout details
– Any relevant error messages

Where to get help or report an issue

  • For getting started and general documentation, please browse, and feel free to contribute to the project documentation.
  • For support questions (“How do I”, “I can’t seem to”, etc.) please search and if not already answered, open a thread in the Support Forums.
  • For technical issues (e.g., to submit a bug or feature request) please search and if not already filed, open an issue on GitHub.

<

h3>Things to check before reporting an …

Capturas de tela

Choose Export to Jekyll from the Tools menu to download your site as a zip file.

Choose Export to Jekyll from the Tools menu to download your site as a zip file.

The zip has your posts, drafts, pages, and settings, laid out for Jekyll.

The zip has your posts, drafts, pages, and settings, laid out for Jekyll.

Each post is Markdown with YAML front matter: title, date, author, categories, tags, and its original URL.

Each post is Markdown with YAML front matter: title, date, author, categories, tags, and its original URL.

Plugins semelhantes

Advanced Order Export For WooCommerce
(350 avaliações)

Export WooCommerce orders to Excel, CSV, XML, JSON, PDF and HTML. Best free order export plugin for WooCommerce.

WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel
(413 avaliações)

Easily export data from any post type, custom field, or taxonomy to a CSV, XML, or Excel file of any custom format. Supports WooCommerce products, ord …

Customizer Export/Import
(114 avaliações)

Easily export or import your WordPress customizer settings!

Import and export users and customers
(259 avaliações)

Bulk import and export WordPress users and WooCommerce customers from CSV, including roles, passwords and any custom meta.

YML for Yandex Market
(72 avaliações)

Creates a YML-feed to upload to Yandex Market and not only.

GravityExport Lite for Gravity Forms
(39 avaliações)

Export all Gravity Forms entries to Excel (.xlsx) or CSV via a download button or a secret shareable URL.