# Sigma ImportX Engine - Sample CSV Files

This directory contains sample CSV files that demonstrate the correct format for importing different types of content into WordPress.

## Available Samples

### 1. Posts Sample (`posts-sample.csv`)
Import WordPress posts with all standard fields and custom meta.

**Fields:**
- `post_title` - Post title (required)
- `post_content` - Post content (HTML allowed)
- `post_excerpt` - Brief description
- `post_status` - publish, draft, pending, private
- `post_author` - Author ID or username
- `post_date` - Publication date (YYYY-MM-DD HH:MM:SS)
- `post_name` - URL slug
- `featured_image` - Image URL or filename
- `categories` - Comma-separated category names
- `tags` - Comma-separated tag names
- `meta_*` - Custom fields (prefix with meta_)

### 2. Users Sample (`users-sample.csv`)
Import WordPress users with roles and custom meta.

**Fields:**
- `user_login` - Username (required)
- `user_email` - Email address (required)
- `user_pass` - Password (leave empty to auto-generate)
- `display_name` - Display name
- `first_name` - First name
- `last_name` - Last name
- `role` - User role (administrator, editor, author, contributor, subscriber)
- `meta_*` - Custom user meta (prefix with meta_)

### 3. Categories Sample (`categories-sample.csv`)
Import WordPress categories with hierarchical structure.

**Fields:**
- `name` - Category name (required)
- `slug` - URL slug
- `description` - Category description
- `parent` - Parent category name or ID
- `taxonomy` - Taxonomy name (default: category)

### 4. Tags Sample (`tags-sample.csv`)
Import WordPress tags.

**Fields:**
- `name` - Tag name (required)
- `slug` - URL slug
- `description` - Tag description
- `taxonomy` - Taxonomy name (default: post_tag)

## Import Options

### Import Modes
- **Create Only**: Only create new records, skip existing ones
- **Update Only**: Only update existing records, skip new ones
- **Upsert**: Create new records and update existing ones

### Batch Size
For large imports, adjust the batch size (default: 50 rows per batch).

### Background Processing
Imports with more than 100 rows are automatically processed in the background to prevent timeouts.

## Field Mapping

When importing, you can:
1. Map CSV columns to WordPress fields
2. Skip unwanted columns
3. Set default values for empty fields
4. Save mapping templates for reuse

## Custom Fields

To import custom fields (post meta, user meta, term meta):
- Prefix the column name with `meta_`
- Example: `meta_phone` will be saved as `phone` meta key

## Tips

1. **File Encoding**: Use UTF-8 encoding for international characters
2. **Date Format**: Use YYYY-MM-DD HH:MM:SS format
3. **HTML Content**: HTML tags are allowed in content fields
4. **Categories/Tags**: Separate multiple values with commas
5. **Images**: Provide full URL or filename from media library
6. **Required Fields**: Each import type has specific required fields
7. **Parent Relationships**: Use names or IDs for parent references

## Troubleshooting

- **Import Fails**: Check the import logs for specific error messages
- **Missing Images**: Ensure image URLs are accessible
- **Invalid Dates**: Use the correct date format
- **Duplicate Content**: Choose the appropriate import mode
- **Memory Issues**: Reduce batch size for very large files

## Support

For more information, refer to the main plugin documentation.
