> ## Documentation Index
> Fetch the complete documentation index at: https://docs.commentify.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Disqus and WordPress

> Idempotent XML imports into the comments table. Imported authors become guests; re-runs skip existing import_id rows.

Moving a site to Laravel is only half the migration. Pro imports Disqus XML and WordPress WXR into the same polymorphic `comments` table Livewire and the API already use.

**Requires** `core.allow_guests` — imported authors become guest comments (`guest_name` / `guest_email`). Enable guests first.

Migrate (or recreate) articles so each commentable has a stable id you can pass as `--id`.

## Disqus

Export XML from Disqus admin. Map each thread to one commentable:

```bash theme={null}
php artisan commentify:import-disqus storage/disqus.xml \
    --commentable=articles --id=1 --approve
```

## WordPress

Tools → Export (WXR) including comments:

```bash theme={null}
php artisan commentify:import-wordpress storage/export.xml \
    --commentable=articles --id=1 --approve --dry-run
```

`--dry-run` parses and counts without writing.

## Options (both commands)

| Option           | Meaning                                                                                            |
| ---------------- | -------------------------------------------------------------------------------------------------- |
| `--commentable=` | Alias from `commentables` (required)                                                               |
| `--id=`          | Commentable primary key (required)                                                                 |
| `--dry-run`      | Parse only                                                                                         |
| `--approve`      | Set `is_approved = true` (without it, imported rows stay unapproved)                               |
| `--skip-spam`    | Accepted; imports already run `Comment::withoutEvents`, so the observer/spam pipeline does not run |

## Idempotency

Each source row stores `import_source` (`disqus` or `wordpress`) + `import_id`. Re-running skips rows that already exist and still rebuilds the parent map so nesting survives a partial first run. Core 4.0 indexed these columns on `comments`.

Parent/child ids rematerialize in a second pass after all rows are inserted.

Original timestamps are preserved when the export includes them.

## After import

Point the frontend at the commentable as usual:

```blade theme={null}
<livewire:comments :model="$post" />
```

Or React/Vue with the same alias. Deep links to `#comment-{id}` work once `commentifyUrl()` is implemented — old Disqus URLs will not magically redirect; keep a mapping if SEO depends on them.
