Docs/Connecting WordPress

Connecting WordPress

Connect your WordPress site to browse and import content.

Connecting WordPress

PhantomWP can connect to your WordPress site to import content and use it as a headless CMS. This lets you continue using WordPress for content management while serving a fast Astro site to your visitors.

WordPress Connection

Prerequisites

Your WordPress site needs:

  • WordPress REST API enabled (default in WordPress 4.7+)
  • Public access to the REST API (or proper authentication)
  • Posts or pages with "Published" status

How to Connect

  1. Open your project in the PhantomWP IDE
  2. Click the WordPress icon in the header
  3. Enter your WordPress site URL (e.g., https://yoursite.com)
  4. Click Connect

WordPress Modal

PhantomWP will test the connection and show what content is available.

What Gets Connected

When you connect WordPress, PhantomWP can access:

Posts

  • All published blog posts
  • Post content (HTML)
  • Featured images
  • Categories and tags
  • Author information
  • Publication dates
  • Custom fields (if exposed via REST API)

Pages

  • All published pages
  • Page content
  • Featured images
  • Parent/child relationships

Media

  • Images uploaded to the media library
  • File URLs and metadata
  • Alt text and captions

Taxonomies

  • Categories
  • Tags
  • Custom taxonomies (if registered for REST API)

Connection Options

Site URL

The base URL of your WordPress site. Include https:// but not trailing slashes.

Examples:

  • https://mysite.com
  • https://blog.mysite.com
  • https://mysite.com/
  • mysite.com

Authentication (Optional)

For private content or protected REST APIs, add authentication:

Application Password

  1. In WordPress, go to Users → Profile
  2. Scroll to Application Passwords
  3. Enter a name and click Add New Application Password
  4. Copy the generated password
  5. Enter it in PhantomWP's WordPress settings

Application Password

JWT Token

If your site uses JWT authentication:

  1. Get a JWT token from your authentication endpoint
  2. Enter it in the token field in PhantomWP

Verifying the Connection

After connecting, PhantomWP shows a summary:

  • ✓ Connection successful — API is accessible
  • Posts found: X — Number of published posts
  • Pages found: X — Number of published pages
  • Media items: X — Number of media files

Connection Success

Troubleshooting

"Connection Failed"

Check that:

  1. Your WordPress site is accessible
  2. The URL is correct (no typos)
  3. Your site doesn't block the REST API
  4. You're using HTTPS if required

"REST API Not Available"

Some security plugins disable the REST API. Check:

  1. Is the REST API intentionally disabled?
  2. Is there a security plugin blocking it?
  3. Does your hosting provider block API access?

Test manually by visiting: https://yoursite.com/wp-json/wp/v2/posts

"No Posts Found"

Make sure you have:

  1. At least one published post (not draft)
  2. Posts that aren't password-protected
  3. Posts visible to the REST API

Authentication Issues

If using Application Passwords:

  1. Make sure Application Passwords are enabled
  2. The password is entered correctly (no spaces)
  3. Your user has permission to read posts

Security Considerations

When connected:

  • PhantomWP only reads data from WordPress
  • Your WordPress login credentials are stored securely
  • Connection happens from your browser to WordPress

For maximum security, see our WordPress Security guide on hiding your WordPress site from the public while keeping it accessible to PhantomWP.

Disconnecting

To disconnect your WordPress site:

  1. Click the WordPress icon
  2. Click Disconnect
  3. Confirm the action

This removes the connection but doesn't affect already-imported content.

Next Steps