The minimum file set WordPress requires
A theme does not need dozens of files to be installable. WordPress only strictly requires style.css with a valid header comment and index.php to display something. Everything else, header.php, footer.php, functions.php, sidebar.php, is a convention that makes the theme maintainable and compatible with the wider ecosystem, but is not enforced by the installer.
For a theme meant to actually render a converted site well, you will want at minimum style.css, index.php, header.php, footer.php, and functions.php, with screenshot.png for the theme browser preview.
- style.css — required, holds the theme header and CSS
- index.php — required, fallback template
- header.php / footer.php — recommended, wrap get_header()/get_footer()
- functions.php — recommended, enqueue scripts and styles here
- screenshot.png — recommended, 1200x900px preview image
Folder structure before you zip
Create one folder named after your theme slug, for example my-theme, and place every file directly inside it, not inside a further subfolder. The folder name becomes the theme's directory name once installed at /wp-content/themes/my-theme/, so keep it lowercase, hyphenated, and free of spaces.
- Create a folder named exactly like your theme slug (lowercase, hyphens, no spaces).
- Place style.css, index.php, functions.php, header.php, footer.php inside that folder.
- Add an assets or css/js subfolder for stylesheets and scripts if needed, referenced via wp_enqueue_style/wp_enqueue_script.
- Add screenshot.png at 1200x900px in the root of the theme folder.
- Select all files inside the theme folder (not the folder itself) and compress them into a zip, ensuring style.css lands at the zip's top level or one clean folder level deep.
Zipping without introducing a nested folder
On macOS, right-clicking a folder and choosing Compress creates a zip where the folder itself is the top-level entry — this is actually fine for WordPress, since it walks one level into the top folder looking for style.css. The problem occurs when people zip a parent folder that contains the theme folder inside it, adding an extra unwanted layer.
On Windows, "Send to > Compressed (zipped) folder" behaves the same way. Always double check with unzip -l or by extracting the archive yourself before uploading, so you can see exactly what WordPress will see.
Verifying the style.css header before packaging
WordPress reads specific fields from the comment block at the top of style.css to display the theme name, author, and version in the admin. If this header is malformed or missing required fields like Theme Name, the install may still succeed but the theme will appear with blank or garbled information in Appearance → Themes.
See our dedicated guide on the required style.css header fields for the exact syntax WordPress expects.
Testing the package before distributing it
Before sharing a theme zip with a client or uploading it to a production site, install it on a local WordPress environment first. This catches structural mistakes, PHP fatal errors, and missing screenshot files in a low-stakes environment rather than in front of a client or on a live site.
Automating packaging when converting an existing site
When the source of your theme is an existing live webpage rather than a theme you are writing from scratch, manually recreating this folder structure for every page template is repetitive and error-prone. The Themify extension captures a live page and outputs it as a correctly packaged WordPress theme automatically, style.css header, index.php, and asset folders included, which is the fastest route if you are converting many sites rather than hand-coding one.
If you are building a theme from scratch for a client project, packaging by hand still gives you full control over the code, and the checklist above is enough to get it right every time.
Frequently asked questions
- Do I need header.php and footer.php to install a theme?
- No, only style.css with a valid header and index.php are strictly required by the WordPress installer, though most real themes include header.php and footer.php for maintainability.
- What should I name the theme folder before zipping?
- Use a lowercase, hyphenated slug matching your theme name, such as my-theme, since this becomes the folder name under wp-content/themes/ after install.
- Can a theme zip contain subfolders for assets?
- Yes, subfolders like css/, js/, or images/ are fine as long as style.css and index.php remain in the theme's root directory, referenced correctly via get_template_directory_uri().
- Is there a tool that validates a theme package before upload?
- The Theme Check plugin, installable on a local WordPress site, scans a theme's files for structural and coding standard issues before you distribute or submit it.
