Documentation

Importing WordPress Sites

Convert your WordPress site to a modern Laravel application

Import your WordPress site and rebuild it as a modern Laravel application.

Philosophy

Standard WordPress functionality (Posts, Categories, Tags) is the same for every WordPress site. Instead of rebuilding this from scratch each time, Stellify provides a WordPress scaffold that sets up these standard models, controllers, and migrations. The import skill then focuses only on what's custom about your specific WordPress site.

Prerequisites

Before importing a WordPress site:

  1. Run the WordPress scaffold first — Go to Project Settings and click "Scaffold WordPress Core" to create standard models (Post, Category, Tag) with their controllers and migrations
  2. Configure your project database — Ensure your Stellify project has a database connection configured (Project Settings → Database)
  3. Run migrations — The scaffold creates migrations that need to be run to create the tables
  4. Visual/styling conversion — Template styling is handled separately from data structure import

Quick Start

Step 1 — Run the WordPress Scaffold

In the Stellify editor, go to Project Settings and click Scaffold WordPress Core. This creates:

  • Post model (title, slug, content, excerpt, featured_image, status, published_at, author_id, meta_title, meta_description)
  • Category model (name, slug, description)
  • Tag model (name, slug)
  • Controllers with CRUD operations
  • Migrations with proper relationships (Post belongsToMany Category/Tag, Post belongsTo User)

Step 2 — Import Content Directly

In the WordPress Import panel (Project Settings), enter your WordPress site URL and click Preview to see what content is available:

  1. Enter your WordPress URL — e.g., https://your-wordpress-site.com
  2. Add authentication (optional) — For drafts, private posts, and users, enter username:app_password
  3. Select content types — Choose which content to import (posts, categories, tags, users)
  4. Click Preview — See counts of available content
  5. Click Import — Content is imported directly into your Stellify project database

The import runs immediately in the Stellify editor — no need to export your project first. You can see your imported content right away in the editor.

Authentication for Private Content

For private content and user imports, create an Application Password in your WordPress dashboard:

  1. Go to Users → Your Profile → Application Passwords
  2. Enter a name (e.g., "Stellify Import") and click Add New
  3. Copy the generated password
  4. Enter your-username:generated-password in the Auth field

The import uses the WordPress REST API, which is enabled by default on WordPress 4.7+.

Step 3 — Export Import Service for Re-syncs (Optional)

If you need to re-import content after deploying your app (e.g., for ongoing content updates), you can scaffold an import service for your exported project:

  1. Expand the Export Import Service section
  2. Click Add Import Service

This creates:

  • WordPressImportService — Pulls content via REST API
  • wp:import artisan command — CLI tool for running imports

After exporting and deploying your project, you can run:

# Basic import (public posts, categories, tags)
php artisan wp:import https://your-wordpress-site.com

# Import with authentication (for drafts, private posts, users)
php artisan wp:import https://your-wordpress-site.com --auth=username:app_password --users

# Skip specific content types
php artisan wp:import https://your-wordpress-site.com --skip-posts --skip-tags

Step 4 — Install the Import Skill (Optional)

For a guided import experience with custom post types and ACF fields, add the WordPress import skill to your project:

mkdir -p .claude/skills/wordpress-import
curl -o .claude/skills/wordpress-import/SKILL.md https://raw.githubusercontent.com/Stellify-Software-Ltd/stellify-mcp/main/skills/wordpress-import.md

Add the skill to your CLAUDE.md:

## Skills

- wordpress-import: Use this skill when importing WordPress sites into Stellify. Invoke with /wordpress-import to start the guided workflow.

Step 5 — Run the Guided Import

Type /wordpress-import in your editor to start the guided workflow for custom post types and ACF fields.

Import Workflow

Step 1 — Verify WordPress Scaffold

The import skill first checks that standard WordPress models exist (app/Models/Post.php, Category.php, Tag.php). If not, it prompts you to run the scaffold before proceeding.

Step 2 — Analyse the WordPress Project

The skill performs comprehensive analysis to understand what's custom about your site:

2a. Identify active theme

  • Classic PHP theme or block theme (theme.json)

2b. Scan for custom post types & taxonomies

  • Check functions.php for register_post_type() and register_taxonomy() calls
  • Detect CPT plugins (Custom Post Type UI, Pods, etc.)

2c. Scan plugins directory

  • Functionality plugins (WooCommerce, ACF, forms) — need attention
  • Low priority (SEO, caching, security) — usually skip
  • Builder plugins (Elementor, WPBakery) — affects where templates are stored

2d. Database analysis Run diagnostic queries to find:

  • Custom post types actually in use (with content counts)
  • Custom taxonomies in use
  • Custom meta keys (reveals ACF fields, custom fields)
  • Shortcodes embedded in content
  • Gutenberg blocks in use

2e. Produce analysis report Structured summary showing:

  • Theme info
  • Content counts
  • Custom post types (name, slug, supports, count)
  • Custom taxonomies (name, slug, attached to, hierarchical, term count)
  • Custom fields discovered
  • Plugins requiring attention
  • Content flags (shortcodes, page builder usage)
  • Generation plan (what will be created vs what's already scaffolded)

You'll be asked to confirm before proceeding.

Step 3 — Generate Custom Resources

For each custom post type and taxonomy identified:

3a. Custom post type models

  • Model, migration, controller with:
    • Standard fields (title, slug, content, excerpt, status, published_at, author_id)
    • Custom fields from meta analysis
    • getRouteKeyName() returning 'slug'
    • Relationships to custom taxonomies
    • Published scope

3b. Custom taxonomy models

  • Fields (name, slug, description, parent_id if hierarchical)
  • Pivot table for relationships

3c. Routes

  • Following WordPress URL conventions

Step 4 — Document Manual Tasks

The skill creates a summary of items needing manual attention:

  • Forms (list fields and purpose)
  • Shortcodes in content (need processing during migration)
  • Plugin functionality (WooCommerce, memberships, etc.)
  • Content migration steps (export, transform, import, process shortcodes, migrate media)

Key Rules

Rule Description
Analysis first Complete full analysis before generating any code
Only generate custom elements Standard models come from scaffold
Fresh database only No WordPress table connection
No template conversion Visual design handled by separate skill
Be pragmatic Focus on post types/taxonomies that actually have content

Before You Start

REST API Import (Recommended)

The Stellify editor imports directly from your WordPress site via its REST API. No manual export is needed — just enter your WordPress URL and authenticate if required.

Requirements:

  • WordPress 4.7 or later (REST API enabled by default)
  • Site must be publicly accessible (or use authentication for private content)
  • For private posts, drafts, and users: Create an Application Password in WordPress

Manual Export (Alternative)

If REST API access is not available, you can manually export content:

Option 1: WordPress XML Export

In WordPress admin: Tools → Export → All content → Download Export File

Option 2: WP-CLI

# Export all content
wp export --dir=./export

# Export specific post types
wp export --post_type=post,page,product

Option 3: REST API (manual)

# Export posts
curl "https://yoursite.com/wp-json/wp/v2/posts?per_page=100" > posts.json

# Export pages
curl "https://yoursite.com/wp-json/wp/v2/pages?per_page=100" > pages.json

Gather Your Theme Files

Copy your theme folder locally. The AI will read:

  • header.php, footer.php — Global layout
  • index.php, single.php, page.php — Templates
  • functions.php — Custom functionality (important for CPT detection)
  • Template parts in /template-parts/

Note Your Active Plugins

List plugins that add functionality you want to preserve:

  • Forms (Contact Form 7, Gravity Forms, WPForms)
  • E-commerce (WooCommerce)
  • Custom fields (ACF, Meta Box)
  • Page builders (Elementor, Beaver Builder)

WordPress to Stellify Mapping

Content Types

WordPress Stellify Source
Posts Post model + API Scaffold
Categories Category model Scaffold
Tags Tag model Scaffold
Custom Post Types Custom models Import skill
Custom Taxonomies Custom models Import skill

Common Functions

WordPress Function Stellify Equivalent
the_title() {{ $post->title }} or {{ post.title }}
the_content() {!! $post->content !!} or v-html
the_excerpt() {{ $post->excerpt }}
get_the_date() {{ $post->published_at }}
the_post_thumbnail() <img src="{{ $post->featured_image }}">
have_posts() / the_post() @foreach($posts as $post) or v-for
WP_Query Post::query() or Http.get('/api/posts')
get_permalink() route('posts.show', $post)

Plugin Equivalents

Contact Forms

WordPress form plugins become Stellify Form components:

import { Form, Http } from 'stellify-framework'

const form = Form.create({
  name: '',
  email: '',
  message: ''
}).rules({
  name: 'required|min:2',
  email: 'required|email',
  message: 'required|min:10'
})

async function submit() {
  if (await form.validate()) {
    await Http.post('/api/contact', form.data())
  }
}

Custom Fields (ACF)

ACF field groups become model fields and migrations. The import skill detects these from the wp_postmeta table and adds them to your custom post type models.

WooCommerce

WooCommerce is a major plugin that should be imported separately. Use the dedicated WooCommerce import skill for:

  • Product model with all fields
  • ProductController with CRUD
  • Order, Customer, Coupon models
  • API routes for the catalog

Content Migration

Posts and Pages

After models are created, migrate content using seeders:

  1. Export WordPress content (XML or JSON)
  2. Create a seeder to map WordPress fields to Eloquent models
  3. Handle relationships (author, categories, tags)
  4. Process shortcodes in content

Media Files

For images and files:

  1. Upload media to your hosting/CDN
  2. Update URLs in content
  3. Or create a media migration script to rewrite paths

Importing Plugins Separately

When importing a WordPress site with major plugins, import the core site first, then handle plugins separately:

  1. Run WordPress scaffold — Standard models
  2. Run import skill — Custom post types and taxonomies
  3. Import plugins individually — Each plugin as its own session

For popular plugins, check the Stellify Skills Repository for dedicated import skills:

  • WooCommerce — Products, orders, customers, coupons, shipping zones
  • Advanced Custom Fields — Field groups, layouts, flexible content
  • Gravity Forms — Form configurations, entries, notifications

Troubleshooting

Content not displaying correctly

  • Check that {!! !!} or v-html is used for WordPress content (it contains HTML)
  • Verify API endpoints return the expected data
  • Ensure relationships are loaded (eager loading)

Shortcodes appearing as text

  • Shortcodes need to be processed during content migration
  • The import skill documents which shortcodes are in use
  • Create Vue components or Laravel helpers to replace shortcode functionality

Missing custom fields

  • Check that ACF or custom field data was exported
  • Custom fields are stored in wp_postmeta — ensure this table is included in your export
  • The import skill detects custom meta keys automatically

Custom post types not detected

  • Ensure functions.php is included in your theme files
  • Check for CPT plugins (Custom Post Type UI creates JSON config files)
  • The import skill scans the database for post types actually in use