Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To build a custom WordPress site and bring over existing posts or pages, handle two separate jobs: create and activate a theme for how the site looks, then export and import content as a WXR XML file. Choose a block theme if you want to edit templates and site areas in the Site Editor; choose a classic theme if your project is built around PHP templates. A theme ZIP is not a content export, and a WXR file is not a theme installer.

Choose a block theme or a classic theme

“Custom-coded” can mean either of WordPress’s two theme approaches. WordPress Developer Resources describes a theme as representing the design of a website; the choice determines how you build and edit that design.

Approach How it works Choose it when
Block theme HTML templates use block markup, and the Site Editor can edit templates and other site areas. You want to adjust layouts such as headers, footers, and templates in WordPress’s Site Editor.
Classic theme PHP template files render pages using WordPress template tags; the template hierarchy selects the file for a request. Your project depends on PHP templates or the traditional theme system.

Block themes have been part of the WordPress ecosystem since version 5.9, but check the version and available editing features on your own installation rather than assuming they are enabled. If your existing site or plugins rely on classic-theme behavior, verify compatibility on that site before choosing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build the theme files

Block theme: start with the required files

A minimal block-theme structure includes a stylesheet, a block template, and commonly a configuration file:

my-custom-theme/
├── style.css
├── theme.json
└── templates/
    └── index.html

WordPress requires style.css and a template such as templates/index.html for recognition as a block theme. Add parts/ for reusable template parts, patterns/ for reusable block patterns, and additional templates as the site needs them.

Use theme.json to configure global settings and styles, including color, typography, and block appearance controls. WordPress Developer Resources calls it “a configuration file that lets you define the global settings, styles, and more for your theme.” It is useful, but not technically required for a block theme.

Theme values are not always the final values visitors see. WordPress applies defaults, theme settings, child-theme settings, and then user configuration; saved user settings can override theme values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Classic theme: build PHP templates

A classic theme uses style.css for theme metadata and PHP files for rendering. index.php serves as the catch-all template, while other PHP templates can handle specific contexts according to the template hierarchy. Template tags let those files display WordPress content. The exact files you need depend on the theme you are building; the checklist for themes submitted to the theme directory should not be treated as a universal specification for every private theme.

Export and import content separately

A theme controls presentation; posts and pages remain WordPress content data. To move content to another WordPress site, export it from the source site and import it at the destination.

  1. On the source site, open Tools > Export. Choose the content to export. WordPress can create a WXR XML file containing content such as posts, pages, comments, custom fields, taxonomies, and users. Depending on the available filters, you can narrow the export by content type, author, dates, or status.
  2. On the destination site, run the WordPress importer. Use the import option for a WordPress export, select the WXR file, and follow the importer’s prompts. The importer supports content such as posts, pages, comments, custom fields, and categories from a WordPress export.
  3. Activate or configure the destination theme separately. The WXR file transfers supported content; it does not install your custom theme.

WXR is a content export, not a full-site backup. Keep a separate backup plan for anything outside the content covered by the export.

Export a block theme from the Site Editor

If you have made block-theme changes in the Site Editor, its Export action downloads a ZIP containing templates, template parts, and style settings. That ZIP is separate from the WXR XML file: use the ZIP for the edited theme files and the WXR export/import workflow for content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check the destination after migration

Do not assume that imported content and media will look exactly as they did on the source site. WordPress represents uploaded files in the media library; files can be attached to posts, and themes can display attachment content through templates. Review the destination site in context:

  • Open representative posts and pages and confirm their content appears.
  • Check authors, categories, and other taxonomies that matter to the site.
  • Test navigation and verify that the active theme renders the imported content as intended.
  • Open pages with images or files and confirm the media loads on the destination.

If an image or attachment is missing, investigate that item on the destination rather than assuming the theme ZIP or WXR file brought every media file across automatically.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.