CSV Import
Last updated
Last updated
Rather than manually add shortcodes to your , Snippet Shortcodes has a CSV import tool which allows you to bulk import shortcodes.
Note: Depending on your server, you may need to split larger CSV files into smaller, more manageable sizes for performance reasons. As a guide, we'd recommend processing no more than 500 rows at a time.
A CSV file must adhere to the following rules:
Have a header row with the following headers:
Note: The column "content" is required however, the data for each row can be left blank if not required.
Have one or more data rows.
For each row, ensure the following are met:
Has a "slug" that is 100 characters or less.
Ideally have a value for "content" - otherwise you're importing a blank column.
A value of "yes", "no", "true" or "false" for "global".
A value of "yes", "no", "true" or "false" for "enabled".
Note: If the import finds the above rules haven't been met, then the row will either be skipped or fail.
A simple CSV example
Below is a sample CSV with 40 shortcodes:
Importing a CSV file
Via the WordPress Admin menu, navigate to "Snippet Shortcodes" > "Import Shortcodes".
Using the button labelled "Select CSV", choose a CSV file already uploaded into your Media Library or upload a new one from your computer.
Examine the output report and action any errors.
Dry run mode
If selected, dry run mode will run basic tests against each row without attempting to update the database. We recommend you do this before performing an import as it gives the opportunity to correct any issues before attempting the main import.