Skip to content

Importing the Sample Content

Only for a brand-new (empty) WordPress. The WordPress importer can only create content — it can never update existing posts or pages. Importing this sample into a site that already has content produces duplicates (posts, pages, categories, menus and media all get re-created), and the sample’s front page / menu setup assumes an empty install. If your site already has content: stop, take a backup, and set up a fresh WordPress instead.

What you need before starting

RequirementWhy
Fresh WordPress (installation wizard just finished)The importer creates content; it cannot replace or merge it
Admin accessImporting, menus, front page and permalinks are all admin tasks
Theme Blogtail General activeThe sample is meant to be viewed with this theme
WindPress plugin active (Tailwind CSS v4 mode)Without it the sample renders unstyled
The sample fileNot attached yet — its name/location will be filled in once provided
A database backupThe importer has no undo

Step 1 — Prepare the empty install

Take a backup first

docker exec wordpress_db sh -c \
  'mariadb-dump -u root -p"$MYSQL_ROOT_PASSWORD" --single-transaction --databases wordpress' \
  > ~/wordpress-before-sample-$(date +%F).sql

Remove the default content

A fresh install ships one post (Hello world!), one page (Sample Page) and a privacy policy draft. Delete them so the sample is the only content on the site.

Activate the theme and the plugin

Appearance → Themes → Blogtail General; Plugins → ensure WindPress is active in Tailwind CSS v4 mode.

Step 2 — Import the sample

Open the importer

Tools → Import → WordPress → Install Now (installs the wordpress-importer plugin) → Run Importer.

Upload the sample file

Choose the sample file (WordPress export format, .xml) → Upload file and import. If the sample ships as a ZIP, extract it first and upload the .xml inside.

Assign an author

Only content is imported — users are not. Either pick an existing admin under Assign posts to an existing user, or create an author user first and pick that one.

Import the attachments

Tick Download and import file attachments if the sample references images; they are fetched into wp-content/uploads/. If the sample bundles the images locally, upload them afterwards through Media → Add New.

Run the import

Click Submit and wait — the importer processes items one by one and normally reports which item failed, if any.

Step 3 — Finish the setup (not part of the file)

Set the front page

Settings → Reading → Your homepage displays → A static page → pick the sample’s home page, plus a posts page if the sample provides one.

Assign the menu

Appearance → Menus (or Appearance → Customize → Menus) → select the menu the import brought in → tick the theme’s menu location → Save.

Check widgets

Appearance → Widgets: this theme registers no widget areas — the sidebar in a single post is rendered by the theme’s own template (sidebar-single.php).

Flush permalinks

Settings → Permalinks → Post name → Save Changes, so the imported posts resolve instead of returning 404.

VerifyExpected
HomeHero plus the “Latest Articles” card grid
Single postBreadcrumb, category badge, meta row, sidebar, author box, Related Posts
Archives / searchArchive header + the same card grid
MediaImages under wp-content/uploads/<year>/<month>/

How it works (so you understand what the importer does)

The sample is a WXR file — WordPress eXtended RSS — the XML produced by Tools → Export. Knowing what is and is not inside it explains both the “new WordPress only” rule and why a few steps stay manual.

In the WXR fileNot in the WXR file
Posts, pages, custom post typesUsers (only author names, as strings)
Categories, tags, termsTheme settings and Customizer values
CommentsWidgets and their assignments
nav_menu terms and menu itemsMenu locations (theme-specific)
Attachment records + wp:attachment_urlThe image files themselves, unless reachable at that URL
Post meta, incl. _thumbnail_idPlugin settings (including WindPress)

What actually happens during the import:

  1. Parse & create. Each <item> becomes a new post with a new ID. Items are matched against existing content by GUID: if a post with the same GUID already exists the item is skipped — nothing is ever updated.
  2. Terms. Categories, tags and nav-menu terms are created, and the post↔term relationships are restored from the file.
  3. Attachments. With Download and import file attachments enabled, each media URL is fetched and stored as an attachment. Files land in wp-content/uploads/<year>/<month>/, and the importer does not de-duplicate — import twice and you have two copies.
  4. Thumbnails. Featured images are post meta pointing at an attachment ID; if the attachment did not import, the post shows up without a thumbnail.
  5. Menus. Menu items are imported as content, but which menu shows in which location is the theme’s nav_menu_locations option and is never imported — you assign it.
  6. Everything else stays untouched. Front page / posts page (page_on_front, page_for_posts), permalink structure, WindPress settings and plugin options live in the database’s options table, not in the file.
There is no “update existing content from the file” path, and no undo. That is exactly why this sample is documented as new WordPress only: on a site that already has content, each import creates a second copy of everything and merges nothing.

Bootstrap alternative: snapshot after the import

Once the sample looks right, capture it so new environments don’t repeat the import:

# database
docker exec wordpress_db sh -c \
  'mariadb-dump -u root -p"$MYSQL_ROOT_PASSWORD" --single-transaction --databases wordpress' \
  > ~/wordpress-with-sample-$(date +%F).sql

# uploaded media (host path on this server)
tar -czf ~/wordpress-uploads-$(date +%F).tar.gz \
  -C /home/www/project/wordpress/web/web/wp-content uploads

Restoring that dump plus the uploads folder on a fresh stack reproduces the sample without running the importer again — the fastest way to get identical environments.

If something goes wrong

SymptomCause / fix
Everything exists twiceThe site was not empty → restore the backup, then re-import on a clean install
Posts return 404 after importSettings → Permalinks → Post name → Save Changes
Home page shows the blog listingSettings → Reading → set the static front page
No menu in the headerAssign the imported menu to the theme’s menu location
Images missingAttachments were not imported (URL unreachable, or the checkbox was off) → upload via Media
Sample looks unstyledWindPress inactive, or not in Tailwind CSS v4 mode

Reference (this server)

ItemValue
WordPress root/home/www/project/wordpress/web/web
Themes.../wp-content/themes/ (Blogtail General 1.0.4 installed)
Uploads.../wp-content/uploads/ (currently 2026/ and windpress/)
Database containerwordpress_db (MariaDB; dump with the MYSQL_ROOT_PASSWORD env)
WP-CLInot available in the wordpress_php container → use wp-admin

Not documented yet

  • The sample file itself: name, format (single .xml or ZIP), where it lives, and how it is distributed (release asset, repository asset, or attached to this page).
  • What the sample contains: number of posts/pages/categories, whether menus and images are included, and which page should become the front page.
  • Whether a dedicated author user should be created for the sample content.
  • Whether the sample expects the theme’s options (logo, colours) to be set manually.