
Dynamic Content From CSV
About
Creating dynamic content with If-So triggers is simple and effective. However, when managing dozens or thousands of content variations, the setup can become time-consuming, and performance may be affected.
The Dynamic Content from CSV extension provides a more scalable approach. It lets you create and manage large numbers of dynamic content variations using a single CSV file, instead of building multiple trigger versions manually.
The extension integrates seamlessly with If-So and offers a flexible solution for a wide range of use cases.
It supports HTML content, works with all caching systems, and allows you to display dynamic content anywhere on your site, including within page templates.
How it works
The CSV extension lets you control dynamic content using a spreadsheet, where each CSV file (bulk) is tied to a single condition type (geolocation, query string, date and time, etc.).
Each row includes:
- A condition value (Column A)
- The content to display (Column B and beyond)
When a visitor meets the selected condition, If-So looks for a matching value in Column A and displays the corresponding content from that row.
This structure allows you to manage thousends of variations efficiently without creating multiple trigger versions manually.
Supported conditions
You can use the CSV method with the following conditions:
- Query string (URL parameter)
- Geolocation (continent, country, state, city)
- User timezone
- Date/time
- Page URL
- Post ID
- User IP
- User details (email / username)
- Referral source
- Custom user profile field
How to set up Dynamic Content from CSV?
Setting up dynamic content with the CSV extension is a simple 3-step process:
Step 1: Create a conditional bulk
- Ensure you have both the If-So Plugin and the CSV Extension installed and active.
- Navigate to If-So > Bulks on your WordPress dashboard.
- Click Add a new bulk and give it a name for your own reference.
- Select a Condition: Choose the specific rule that will govern this table (e.g., Geolocation, User Role, or Page URL).
- Optional:Set up “recurrence” settings to show the same version when the user revisits the page. Learn more.
- Click Create Bulk.
Once saved, your bulk will appear in the If-So > Bulks list.
Step 2: Set up the conditional content
Setting up and editing the bulk’s content is done directly in your dashboard. The bulk table behaves like a spreadsheet, so you can easily copy and paste content from a CSV file. If you prefer, you can also import a CSV file.
When adding your data, ensure it follows this structure:
- Column A (The Condition Value): Enter the specific value that activates the row. The required format depends on the selected condition. For example, if the condition is Geolocation → Country, Column A should contain the country’s ISO code. If the condition is Query String, Column A should contain the parameter value.
A ready-to-use CSV template (conditions and values included) ⬇
See the values that match your condition.
To make things easier, feel free to download the template file from this link
| Condition | Values in column A | Example |
|---|---|---|
| Query String | Enter the parameter value only (no quotes) | If the name of the parameter you had set when you created the trigger was “example”, and you’d like to display content when the page URL contains the query ?example=”value1″, then the value in column A should be value1 |
| Geolocation – Country | The country ISO code (in capital letters ; can be found here) | US, UK, DE, etc. |
| Geolocation – State / City /Continent | The exact location name, with the first letter capitalized. Learn more. | New York, Illinois, Texas, etc. |
| Page URL | The page URL, including the protocol (http:// or https://), www, and a trailing slash (/). | To display dynamic content on the current page, use: https://www.if-so.com/dynamic-content-from-csv/ |
| Post ID | The post ID (how to get the post ID) | 123 |
| User IP | The user IP | 24.156.99.202 |
| Date/ time | The date and time according to the format selected when you create the bulk. | |
| Cookie / Session Variable Value | Cookie – the cookie value Session – the session variable value. | |
| User Data | Username – The username as it appears in the user profile. Email – The user email as it appears in the user profile. | |
| Referral Source | The referral page URL, without http:// or https://, without www, and without a / (slash) at the end of the URL. | |
| Custom User Profile Field | The Meta Field key (name) |
- The Conditional Content Columns (B, C, D…): Enter the text or HTML you want to display. Using multiple columns allows you to place different parts of the same row (for example, a headline in Column B and a button in Column C) in different areas of your page.
Setting up a default (fallback) value
A default value is the value that will be displayed if the condition is not met. It can be left blank if you don’t want to show anything in this case.
To set a fallback for when no conditions are met, enter the value ‘default-content‘ in one of the rows

Step 3: Apply the bulk to your page or site
- Copy the shortcode for the specific column you want to show
e.g., [ifso_bulks id='1' column='B' ajax='yes']
Alternatively, you can apply the dynamic content directly in your page template using the ‘do_shortcode’ function. For example:
<?php echo do_shortcode('[ifso id="XXX" ajax="yes"]');?>
FAQ & Troubleshooting
- Is CSV-based content compatible with page caching?
Yes. The default Ajax loading settings apply to content that loads using the CSV extension.
In addition, you can override the default settings by adding the parameter ajax=”yes” or ajax=”no” to the CSV shortcode.
- Content in columns A is broken after uploading a CSV file or saving a bulk
By default, the number of allowed characters in a single cell in column A is 55. This limitation is intentional to optimize the loading speed of the dynamic content for users who don’t need a higher number of characters.
To change the max allowed number of characters in column A:
- Add the code below to your functions.php file.
- Visit one of your website pages (it will run the code).
- Remove the code from your functions.php file.
function modify_content_column(){ global $wpdb; $wpdb->query("ALTER TABLE {$wpdb->prefix}ifso_bulks_content MODIFY COLUMN version VARCHAR(100);"); } add_action('init','modify_content_column');The code above will change the number of allowed characters to 100. You can replace the number in the code with any other number. Bear in mind that if your file consists of many dynamic versions (thousands), there might be some loading speed implications (they will probably be insignificant, but it is worth checking).
Please note that if you reduce the number of allowed characters, the new number you set will affect content created in the past.
- Content is broken after uploading a CSV file or saving a bulk (in any column except column A)
By default, the number of allowed characters in a single cell (except column A) is 1024. This limitation is intentional to optimize the loading speed of the dynamic content for users who don’t need a higher number of characters.
To change the max allowed number of characters in the relevant column:
- Add the code below to your functions.php file.
- Visit one of your website pages (it will run the code).
- Remove the code from your functions.php file.
function modify_content_column(){ global $wpdb; $wpdb->query("ALTER TABLE {$wpdb->prefix}ifso_bulks_content MODIFY COLUMN content VARCHAR(2048);"); } add_action('init','modify_content_column');The code above will change the number of allowed characters to 2,048. You can replace the number in the code with any other number. Bear in mind that if your file consists of many dynamic versions (thousands), there might be some loading speed implications (they will probably be insignificant, but it is worth checking).
Please note that if you reduce the number of allowed characters, the new number you set will affect content created in the past.