Title: Theme export in WordPress 6.0
Author: Ben Dwyer
Published: May 2, 2022
Last modified: May 3, 2022

---

 [  ](https://profiles.wordpress.org/scruffian/) [Ben Dwyer](https://profiles.wordpress.org/scruffian/)
4:36 pm _on_ May 2, 2022     
Tags: [6.0 ( 76 )](https://make.wordpress.org/core/tag/6-0/),
[dev-notes ( 647 )](https://make.wordpress.org/core/tag/dev-notes/), [dev-notes-6.0 ( 20 )](https://make.wordpress.org/core/tag/dev-notes-6-0/)

# Theme export in WordPress 6.0

The “Export” feature in the Site Editor has been improved so that now you can export
your whole theme, including all the edits you have made to your templates and styles.
Previously the export function only gave you access to your template files. This
change makes it possible to build a blockBlock Block is the abstract term used to
describe units of markup that, composed together, form the content or layout of 
a webpage using the WordPress editor. The idea combines concepts of what in the 
past may have achieved with shortcodes, custom HTML, and embed discovery into a 
single consistent API and user experience. theme using the site editor and easily
share the zip file with anyone.

### **The Export process**

The export process copies all files from the current theme into a zip file. Then
it extracts the template changes that are stored in the database to files and adds
them to the zip file. If these templates have the same names as those in the theme,
they will be overwritten, so that the database version takes precedence. The same
process happens for the `theme.json` file. There are three directories that are 
excluded from the export: `.git`, `node_modules` and `vendor`.

### **Unexpected changes**

The export process may make a few unexpected changes to your templates and theme.
jsonJSON JSON, or JavaScript Object Notation, is a minimal, readable format for 
structuring data. It is used primarily to transmit data between a server and web
application, as an alternative to XML. files.

 1. The output of template files from the database will be sanitized for security reasons.
    You’re most likely to notice this with any CSSCSS Cascading Style Sheets. variables
    in your template files: e.g. `--wp--custom--spacing--outer` would become `\u002d\
    u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002douter`.
 2. The properties in `theme.json` are now sorted alphabetically, so the first time
    you export you might notice some of the objects in your `theme.json` move position.
    This now gives us a standard order for these properties so in future it will be
    easy to know where everything should go.
 3. The schema may be updated – the export will update your `theme.json` schema to 
    match the version of WordPress you are using, so if you theme was created with 
    an older version of WordPress, the schema will be updated to match the version 
    you are on.

### **How to submit a theme**

Once you have your exported theme, you may need to make several changes before you
can submit it to the theme repository.

 1. The screenshot will need to be updated, if you’ve made any visual changes to the
    homepage.
 2. You will have to add a changelog entry to the `readme.txt` file.
 3. You must update the version number of the theme in `style.css`.
 4. If this is a new theme, based on an existing theme, you will also need to update
    the name.
 5. If the theme doesn’t have a license file already you will need to add one.
 6. You will then need to rezip the theme with these changes.
 7. You can now submit the new zip file to [https://wordpress.org/themes/getting-started/](https://wordpress.org/themes/getting-started/).

For more info see:

 *  [Theme Export: Add index.php and style.css #39173](https://github.com/WordPress/gutenberg/pull/39173)
   [@scruffian](https://github.com/scruffian)
 *  [Theme Export: Export the whole theme #39202](https://github.com/WordPress/gutenberg/pull/39202)
   [@scruffian](https://github.com/scruffian)
 *  [Theme Export: If the theme declares a version number, then add a schema #39775](https://github.com/WordPress/gutenberg/pull/39775)
   [@scruffian](https://github.com/scruffian)
 *  [Theme Export: Change the schema url #40106](https://github.com/WordPress/gutenberg/pull/40106)
   [@scruffian](https://github.com/scruffian)
 *  [Theme Export: Remove default theme.json properties on export #39848](https://github.com/WordPress/gutenberg/pull/39848)
   [@scruffian](https://github.com/scruffian)
 *  [Theme Export: Sort theme.json properties #39842](https://github.com/WordPress/gutenberg/pull/39842)
   [@scruffian](https://github.com/scruffian)
 *  [Theme Export: Restore appearanceTools when exporting a theme #39840](https://github.com/WordPress/gutenberg/pull/39840)
   [@scruffian](https://github.com/scruffian)
 * [Theme Export: Use the theme name for the zip file #39471](https://github.com/WordPress/gutenberg/pull/39471)
   [@scruffian](https://github.com/scruffian)

[#6-0](https://make.wordpress.org/core/tag/6-0/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#dev-notes-6-0](https://make.wordpress.org/core/tag/dev-notes-6-0/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2022/05/02/theme-export-in-wordpress-6-0/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2022/05/02/theme-export-in-wordpress-6-0/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2022/05/02/theme-export-in-wordpress-6-0/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2022/05/02/theme-export-in-wordpress-6-0/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2022/05/02/theme-export-in-wordpress-6-0/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2022/05/02/theme-export-in-wordpress-6-0/?share=linkedin)

# Post navigation

[← New features for working with patterns and themes in WordPress 6.0](https://make.wordpress.org/core/2022/05/02/new-features-for-working-with-patterns-and-themes-in-wordpress-6-0/)

[Editor chat summary: Wednesday, 27 April 2022 →](https://make.wordpress.org/core/2022/05/02/editor-chat-summary-wednesday-20-april-2022-2/)