Command line tools for managing the FAQ Manager for Magento 2. Use these for bulk import/export of FAQ data, migrating content between environments, or automating FAQ management in deployment pipelines.
Available Commands
| Command | Description |
|---|---|
faq:export |
Export FAQ questions with translations to CSV |
faq:import |
Import FAQ questions from CSV (create or update) |
faq:export
Exports all FAQ questions with their translations to a CSV file. Useful for backup, migration, or bulk editing in a spreadsheet.
bin/magento faq:export --file /path/to/export.csv
Output:
Exported 42 FAQ questions to /path/to/export.csv
Options
| Option | Required | Description |
|---|---|---|
--file |
Yes | Full path to the output CSV file |
CSV Format
The exported CSV includes:
- FAQ question and answer content
- Topic assignment
- Multi-store translations
- Sort order and status
- The SKUs of the linked products (
product_skus)
When to Use
- Backup before changes - Export current state before bulk modifications
- Migration - Move FAQ content between staging and production
- Bulk editing - Export, edit in a spreadsheet, then re-import
- Content review - Share FAQ content with stakeholders for review
Example: Backup Before Import
# Create backup
bin/magento faq:export --file var/export/faq-backup-$(date +%Y%m%d).csv
# Then safely import new data
bin/magento faq:import --file var/import/new-faqs.csv
faq:import
Imports FAQ questions from a CSV file. Creates new questions or updates existing ones based on matching criteria.
bin/magento faq:import --file /path/to/import.csv
Output:
Imported 15 FAQ questions (10 created, 5 updated)
Options
| Option | Required | Description |
|---|---|---|
--file |
Yes | Full path to the input CSV file |
CSV Format
Use the same format as the export. The easiest way to get the correct format is to first export existing data:
# Export to see the format
bin/magento faq:export --file var/export/faq-template.csv
Then use the exported file as a template for your import data.
Create vs Update
- New questions: Rows without a matching ID create new FAQ entries
- Existing questions: Rows matching an existing ID update that entry
Linking Products
The product_skus column links the FAQ to the products it belongs on, by SKU:
question,answer,product_skus
"How do I wash this jacket?","<p>Cold wash, no tumble dryer.</p>","24-MB01,24-MB04"
The column replaces the links of that FAQ; an empty cell leaves them untouched. A SKU no product carries is skipped and named in the command output:
Import complete: 1 created, 0 updated
Skipped 1 unknown SKU(s): 24-GHOST
When to Use
- Initial content load - Import FAQ content prepared in a spreadsheet
- Bulk updates - Update many questions at once
- Environment sync - Import content exported from another environment
- Content migration - Move FAQ data from another system
Example: Import from Spreadsheet
# Prepare CSV in correct format, then import
bin/magento faq:import --file var/import/faqs.csv
Tips for Successful Imports
- Always export first to understand the expected CSV format
- Use UTF-8 encoding for the CSV file
- Verify required fields are populated: question, answer, topic
- Create a backup export before importing to allow rollback
- Test with a small batch first before importing large datasets
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error during execution |
Automation Examples
Deployment Script
#!/bin/bash
# Export FAQ data as part of deployment backup
bin/magento faq:export --file var/export/faq-pre-deploy.csv
Environment Migration
# On source environment
bin/magento faq:export --file /tmp/faq-data.csv
# Transfer file to target environment
scp /tmp/faq-data.csv target-server:/tmp/
# On target environment
bin/magento faq:import --file /tmp/faq-data.csv
bin/magento cache:flush
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team
For a complete overview of features and configuration options, see Magento 2 FAQ extension.
