Speedy Answers

Enter a keyword or select a category to find the information you’re looking for.
- How can I use If-So to set conditions on an entire page or post type?
There are two main ways to apply conditions to an entire page or post type:
1. Use the “show post” shortcode to load full page content dynamically
Create the page content on a separate page, then use the If-So show post shortcode to display that page as a dynamic version inside a conditional trigger. Repeat this step for each version you want to create. Finally, replace the main page’s content with the trigger shortcode. The result: when a visitor loads the page, If-So evaluates the conditions, renders the appropriate show post shortcode, and displays the content of the corresponding page. Learn more
2. Set up a Conditional Redirect
Instead of loading the content dynamically, you can redirect visitors to different pages based on conditions such as geolocation, query strings, user status, and more. Each audience is sent to a different destination page, allowing you to personalize the entire experience without modifying the original page content. More about conditional redirect.
- How to add CSS to my page or website: 3 methods
There are several ways to add custom CSS to a WordPress site, depending on your needs and level of control.
1. Using the WordPress Additional CSS Customizer
The easiest way to add CSS is through the WordPress Customizer. From your dashboard, go to Appearance → Customize → Additional CSS. A text area will open where you can type or paste your CSS code. As you add styles, you’ll see a live preview of the changes before publishing.
2. Using an HTML block (in the block editor)
If you want to style a specific page or section, you can use an HTML block within the Gutenberg editor. Add an HTML block, wrap your content with
<style>tags, and include your CSS code. For example:<style> h2 { color: #0073aa; } </style>This method applies styles only to that page or post.
3. Using a Child Theme
For advanced customization, create a child theme and add your CSS to its
style.cssfile. This gives you full control and ensures your changes persist after theme updates. It’s the preferred approach for developers or larger design changes. Official WordPress documentation on child themes. - How can I add a cookie on click using HTML?
The following code creates a button that adds a cookie with the name ‘test-cookie-on click’ and the value ‘clicked’ when clicked.
This code can be applied to any HTML element.
The cookie duration in this code is 307584000000 seconds (365 days). Feel free to change the value to fit your requirements.
<button onclick=" let cookieName = 'test-cookie-on click' let cookieValue = 'clicked' let cookieExpireTime = 307584000000 setCookie(cookieName, cookieValue, cookieExpireTime) function setCookie(name,value,time) { var expires = '' if (time) { var date = new Date() date.setTime(date.getTime() + time) expires = '; expires=' + date.toUTCString() } document.cookie = name + '=' + (value || '') + expires + '; path=/' } "> Add a Cookie </button>Result:
- Blocking specific users from the geolocation service
You can block certain users from the geolocation service using one of the following functions (or by creating a custom function of your choice):
Block by the user’s IP (or server IP if it’s a bot)
Add the following code to your function.php file, and replace the XX.XX… and YY.YYY… placeholders with the IPs you want to block.
- The code only blocks the IPs from the geolocation functionality, and not from accessing your website.
- Blocked IPs will see the default content version.
add_filter('ifso_exclude_from_geo',function($exclude){ $exclude['ip'] = ['XX.XX.XXX.XXX','YY.YYY.YYY.YYY']; return $exclude; });Block logged-in users
add_filter('ifso_exclude_from_geo',function($exclude){ if(!is_user_logged_in()){ $exclude['blockme'] = true; return $exclude; } });Block Administrators
add_filter('ifso_exclude_from_geo',function($exclude){ if(is_user_logged_in()){ $user = wp_get_current_user(); if ( in_array( 'administrator', (array) $user->roles ) ) { $exclude['blockme'] = true; return $exclude; } } }); - Is it possible to create a self-selection form with multiple fields?
While we do not offer a pre-built solution for that specific functionality, you can achieve the desired result by following these steps:
- Create multiple select forms and position them on the page.
- Exclude the button in all forms except the last one and set their Ajax value to “yes.” This configuration ensures that the user’s selections in these forms will be processed in the backend without requiring a page reload.
- In the last form, set the Ajax value to “no” and include a button. When the user submits the form, the page will reload.
From the user’s point of view, it will appear as if the entire form was submitted simultaneously.
Example (with two fields):
(Question #1) Gender: [ifso_group_selection type="radio" options="Male,Female" ajax="yes" ] (Question #2) Age group: [ifso_group_selection type="radio" options="0-18,19-26,27-35,35+" redirect="https://if-so.com" ajax="no" button="Continue" orientation="vertical"]Result:
Gender:
Age group:
- How can I load a trigger (set up dynamic content) across all of the website's pages?
With If-So, you can easily insert a trigger above your site’s header on all pages directly from your WordPress dashboard. Additionally, you have the flexibility to exclude specific pages where the trigger should not be included.
For more detailed instructions, you can refer to our documentation on loading a trigger on all pages.
- Can I customize the page/website design (CSS) based on conditions?
Absolutely! With If-So, you have the ability to dynamically load CSS (conditional CSS) and make changes to your website’s design based on specific conditions. Learn More.
- Is it possible to display an event time based on user's timezone?
Absolutely!
With If-So, you can easily set the time and use a shortcode to showcase the event time in the user’s own timezone.
This feature eliminates any confusion and saves users the hassle of performing time conversions.
Whether it’s displaying event schedules, business opening hours, or support availability, your users will appreciate the convenience.
Learn more about using the shortcode for time-based displays.
- Is it possible to initiate a countdown as soon as a user visits a page or performs a specific action?
Yes 🙂 Learn more.
- Can I create an evergreen (looped) countdown?
Yes, with If-So you can create evergreen (looped) countdowns that automatically restart once they reach the end. This allows you to continuously display countdowns and maintain a sense of urgency on your website. Learn more.
- Can I create countdowns? What makes If-So's countdowns special?
If-So’s countdowns are designed to create a sense of urgency and encourage users to take action. What sets If-So’s countdowns apart is their conditional capabilities:
- You can create “EverGreen” countdowns that continuously loop.
- Countdowns can be triggered when a user visits a specific page.
- Countdowns can also be triggered when a user performs a certain action, such as making a purchase.
Learn more about If-So’s Countdowns and their powerful features.
- Can I set up conditional upsells and cross-sells on my WooCommerce website?
Upsells and cross-sells are effective strategies to boost revenue and increase the average order value.
If you are using WooCommerce, If-So enables you to display customized special offers based on the products in the user’s cart or their previous purchase history, either before or after the checkout process. Learn more.
- Can I display the visitor's country flag on my website?
Yes, you can display the visitor’s country flag easily using a simple shortcode. Learn more.
- Is it possible to show different content based on the visitor's membership level or subscription?
If-So offers seamless integration with a variety of membership plugins, empowering you to present distinct content tailored to each user’s membership level or subscription tier.
This feature enables personalized and targeted content based on their membership status.
Learn more about our supported membership plugin integrations: - Can I display different content based on the user's past purchase history?
Absolutely.
If you are using WooCommerce or Easy Digital Downloads, you can leverage If-So to display dynamic content based on the user’s previously purchased products.
To learn more:- The If-So & WooCommerce Integration.
- The If-So & Easy Digital Downloads Integration.
- For other e-commerce plugins, our Custom User Profile Fields Extension provides a solution.
- Conditional WooCommerce Products Display
While blocking or showing different products based on the user’s location is not a built-in option, If-So, in general, provides the ability to display dynamic content according to the user’s location.
Option 1: Displaying Dynamic Content Based on User Location (or any other condition)
If you want to utilize If-So to display conditional products, you can create an If-So trigger (with a geolocation condition or any other). Then, you can use one of WooCommerce’s shortcodes to display only the relevant products.
Here’s an example of a trigger with three versions (you can create as many versions as you need):
Version A:
IF: Geolocation > State > Is > Texas
Then:[products limit="8" columns="4" category="Category#1"]Version B:
IF: Geolocation > State > Is > Florida
Then:[products limit="8" columns="4" category="Category#1"]Default Version:
[products limit="8" columns="4" category="Category#3"]Helpful links
Important Considerations
- In case you are using the geolocation condition, please note that the geolocation service relies on IP-to-location mapping, which may not be 100% accurate. While we utilize a premium, highly accurate database to ensure the best possible accuracy, some discrepancies may occur. You can find more information about IP-to-location services and how they work here.
- If your site includes a “search products” option, the products will appear in the search results based on their relevance to the search query.
Option 2: Creating conditional redirect from the product page
Instead of using the method suggested above, you can create a conditional redirect from the product page to a different page (product or other).
This option is more useful if you have a single product that you want to display in one state and a different variation of it that you want to display in another state.
- How can I change the user self-selection form design?
When you generate the self-selection form using our form generator, you can also set a design for the form, and the CSS will be generated for you.
Applying the CSS to your site is possible in several different ways, and having development skills is not a requirement. How to add custom CSS to your WordPress site.
- Limiting the frequency of pop-up display per user
If-So provides maximum flexibility in determining how often you want to display the pop-up to each user and for how long you want to prevent its display. This option is achieved by adding a cookie to the user’s browser, ensuring that the pop-up is not shown as long as the cookie exists.
- Add the following shortcode to the bottom of your pop-up’s content:
[ifso-add-cookie name='prevent-pop-up' value='yes' time='2628288']* ‘2628288’ represents the cookie expiration date in seconds, equivalent to 30 days. Adjust the expiration time according to your requirements.
- Add another version to your pop-up.
- Drag the new version to the top (place it as version A) to ensure its condition is checked first.
– Set the version’s condition to “If > Cookie > Is > Cookie Name: prevent-pop-up ; Cookie Value: yes”.
-Leave the version’s content blank. - Update the trigger.
The result: When the pop-up is displayed for the first time, a cookie with the name “prevent-pop-up” will be added to the user’s browser. The next time the user visits a page with the pop-up’s shortcode, the condition of version A will be met. Since there is no content in version A, the pop-up will not be displayed.
- Can dynamic content from CSV be loaded with the Ajax (page caching compatibility) option?
Yes. The default Ajax loading settings apply to content that loads using the CSV extension.
In addition, as with standard If-So triggers, 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.
- Can I add users to an audience when a user clicks a button?
The desired result can be easily achieved by adding a parameter to the URL that the button directs users to.
- Create a trigger with a Page URL condition:
If: Page URL > Contains > domain.com?audience=type-1; Then: Your dynamic content (if desired) - Toggle the audience section, located below the condition, and check the relevant “Add to audience” checkbox.
- Paste the trigger’s shortcode on the page/s users are redirected to after clicking the button.
If your button is displayed on several different pages (on your header, footer, pop-up, etc.), and you wish the button to reload the same page, you can set its link value to be ?audience=type-1
- Create a trigger with a Page URL condition:
- Is it possible to display a visitor’s location using a shortcode?
Yes. You can display a visitor’s continent, country, state, city, and timezone anywhere on your site using a simple shortcode.
Example – the shortcode below displays the visitor’s country name
[ifsoDKI type='geo' show='country']The option works out of the box and does not require custom code.
- How accurate is If-So’s geolocation service?
If-So is designed to provide the best possible accuracy for location-based content.
When visitors allow browser location access, the HTML5 Geolocation API can provide very precise, address-level accuracy. When this isn’t available, If-So uses IP-based location detection with a premium database that delivers reliable results for most use cases.
As with any IP-to-location solution, accuracy can vary depending on factors such as the visitor’s network or ISP, especially on mobile connections.
- Which geolocation service does If-So use?
If-So uses the ipinfo premium IP-to-location database for geolocation-based content. We’ve found it to be highly accurate compared to similar services, and it is regularly updated to ensure reliable results.
If you come across any inaccuracies, please report them to us and we’ll make sure they’re addressed.If-So uses the ipinfo premium IP-to-location database for geolocation-based content. We’ve found it to be highly accurate compared to similar services, and it is regularly updated to ensure reliable results.
If you come across any inaccuracies, please report them to us and we’ll make sure they’re addressed.
- Is it possible for visitors to manually select/override location?
Yes. You can allow visitors to manually select a location that overrides the automatically detected one.
Once a location is selected, dynamic content is displayed based on the user’s choice.
- How to change the category of If-So cookies?
Yes. You can change the category of specific If-So cookies by using a simple WordPress filter. This is useful if you want better control over how cookies are classified for consent management or compliance tools.
To do this, add the following code to your theme’s
functions.phpfile (or to a custom plugin):add_filter('ifso_cookie_category', function($ctype, $cname) { if ($cname === 'MY_NECESSARY_COOKIE') { return 'necessary'; } return $ctype; }, 10, 2);In this example, the cookie named
MY_NECESSARY_COOKIEis explicitly assigned to the necessary category. All other cookies will keep their original category.Available cookie categories
You can assign cookies to any of the following categories:
necessarystatisticsmarketingpreferences
This allows you to align If-So cookies with your site’s cookie consent logic and ensure they are handled correctly by your consent management solution.
- Does If-So work with cookie consent tools?
If-So integrates natively with three cookie compliance solutions and provides a hook that allows you to link additional services beyond the built-in integrations.
Cookie consent services compatible with If-So:
- Cookiebot (the Cookiebot WordPress plugin is required)
- Cookie Notice & Compliance for GDPR / CCPA
- Complianz (the Complianz WordPress plugin is required)
With these three services, cookies will not be added until the user consents to accept cookies (whether they are server-side cookies or JavaScript cookies).
Please note that If-So integrates natively with Cookiebot and Complianz, but for the integration to work properly the corresponding WordPress plugins must be installed and active on your site.
Realted questions:
- Can I spilt test 2 WordPress pages using If-So?
Yes, technically, you can. Though one of the biggest advantages of If-So is that you don’t have to duplicate pages. Instead, you can split-test only a specific piece of content on the same page.
Nevertheless, if you want to split-test a whole page, you can do so using a simple JavaScript redirect code that can be pasted inside an If-So trigger. We already have the redirect code ready for you. You can learn more and find it here.
- Is it possible to block a page from users of a certain country?
Yes. You can create a conditional redirect to redirect all the visitors from a specific certain to a different page.
- Can I display the user's name on a website page using If-So?
Yes, you can achieve this in different scenarios:
- If the user is logged in, you can use our User Details Shortcode to display the user’s name.
- If the user is not logged in, you can pass the user’s name as a value in a query parameter in the URL and then utilize our Query-string DK shortcode to dynamically insert and display the name. The user’s name can be stored as a cookie, allowing it to be accessed and displayed on different pages as the user continues browsing the website.
- Can the Geolocation DKI Shortcode display location names in other languages?
The DKI shortcode retrieves values directly from our IP-to-location database and is limited to displaying location names in English. However, our CSV extension offers a solution:
1. Ensure the CSV extension is installed on your site.
2. Download our “All-countries” CSV file (click to download).
3. Insert the desired language’s location names in column D.
4. On your WP dashboard, create a new bulk with a geolocation condition and upload the file.
5. Paste the CSV shortcode, displaying values from column D, wherever you want to show the country name on your page. - Can I display conditional pop-ups using If-So?
Absolutely! Any If-So trigger can be displayed as a pop-up (overlay). The pop-up will only appear if the condition is met. Learn more about it.
- Is it possible to set up conditional redirects (redirecting users to different pages based on conditions)?
Yes, you can set up conditional redirects based on any If-So condition.
- Which conditions (rules) can I set with If-So?
If-So provides a diverse range of conditions to choose from, including Geolocation, Google Ads search terms, Dynamic links, Schedule, and many more.
- Can I use If-So to show different meta data content (page title and description)?
If-So shortcodes work in YOAST and RankMath title and description fields. They may also work with other SEO plugins, but this cannot be guaranteed. If you choose to embed dynamic content in these fields, ensure the trigger is loaded without AJAX by adding the parameter ajax=”no” to the trigger’s shortcode.
It’s important to note that the content presented on the search result page cannot be dynamic. Search engines scan the site and display the metadata they crawled during their scan.
- How can I Import and Export Triggers?
To import a trigger: On your WordPress dashboard, go to If-So -> All Triggers, click “Import trigger” (the button is right below the page title), and upload your trigger’s JSON file.
To export a trigger: On your WordPress dashboard, go to If-So -> All Triggers, hover over the trigger you want to export, and click “Export”.
- Are there styling options available? If so, how are they accessed?
If-So uses a TinyMCE editor with both visual and text (HTML) modes so that you can basically set up any content.
If you are using a page builder and are looking for a more convenient way to design your content, the styling options that are available for you are:
Gutenberg Users – You can assign conditions directly to a block (or group of blocks) instead of creating dynamic triggers. See how.
Elementor Users – Save any widget or section as a template and apply it inside an If-So trigger using a shortcode. See how.
Other page builders – Design your dynamic content in a new page and use the shortcode inside your If-So trigger to display the page content as your dynamic version. See how.
- Are there any known issues or limitations?
No 🙂 We would love to hear from you if you encounter any issues. Please don’t hesitate to click here and create a support ticket. Our team is here to assist you!
- Does If-So add cookies to my website?
Yes. Depending on the conditions and functions you choose to use, If-so uses cookies for some of its functionalities.
All the cookies set by If-So are first-party cookies (added directly by your site) and thus will not be affected by the phase-out of third-party cookies.
Cookies will only be used once you use a cookie-based condition or feature. Below are the features and conditions that will use cookies:
Conditions:
- Pages visited (cookie name: ifso_page_visits)
- New and returning visitors (cookie name: Ifso_Visit_Counts)
- Trigger Visited (cookie name: ifso_viewed_triggers)
- Geolocation (cookie name: ifso_geo_data; only if you have set the tracking to be using a cookie instead of the default session-based option.
Features
- Recurrence (cookie name: ifso_recurrence_data, ifso_recurrence_session_TRIGGER_ID)
- Audiences (cookie name: ifso_group_name)
- User Selection (based on the “Audiences” cookie)
- Analytics (cookie name: ifso_last_viewed, ifso_viewing_triggers)
The table below shows the cookies names, description, and when they are created:
Cookie Name Description When is the cookie created Type Duration ifso_page_visits Used to keep track of pages visited by the user. Must be enabled in order to use the Pages Visited condition The cookie will not be created and updated if the “Deactivate Pages Visited Cookie” is checked.
Disabling the cookie will not delete the cookie for users that already have the cookiePreferences & Functional Set by the site admin on the plugin’s settings ifso_recurrence_data used for the If-So recurrence option Added when handling a trigger with “Always” or “Custom” recurrence Preferences & Functional 3 years ifso_recurrence_session_TRIGGER_ID Used for the If-So recurrence option Added when handling a trigger with a “Single session” recurrence Preferences & Functional One session ifso_visit_counts Used for user behavior (new/returning/num. of visits) trigger Created and updated (increment) whenever an if-so trigger is rendered Preferences & Functional 1 year (31,104,000 sec) ifso_last_viewed Used to store the triggers’ “viewed last” for Analytics conversions. Created by default. Can be disabled through the plugin’s settings. Performance & Analytics Session ifso_viewing_triggers Holds data on triggers viewed on this page for Analytics in AJAX mode Created by default. Can be disabled through the plugin’s settings (if analytics is turned off or not in AJAX mode) Performance & Analytics One session ifso_viewed_triggers Used for the ‘Triggers Visited’ condition Created by default. Added whenever a trigger is viewed. Can be disabled in the plugin’s settings Preferences & Functional One year ifso_group_name Used for the feature where a user is added to an audience Added only if you use the Groups option Preferences & Functional Configurable via the settings. Defaults to 1 year. ifso_geo_data Holds the cache for If-So’s geolocation data When the “Disable use of PHP sessions” option is enabled in the plugin’s settings. Preferences & Functional Session ifso-geo-override-data Used for the location override functionality If the user selects a location from the list Preferences & Functional Session cookie ifso-request-browser-location Temporary cookie – indicates pending browser geolocation request on user visit When the option ‘Browser-Based Location’ in the plugin’s settings is set to ‘Whenever the user encounters geo-targeted content’ or ‘Every time the user visits the site,’ and the user encounters geo-targeted content, the cookie is deleted after the user chooses to allow or block the browser location option. Preferences & Functional Session ifso-browser-location-data Holds the cache for If-So’s HTML5 Geolocation API data Once the user’s approval to share their browser location is received Preferences & Functional Session ifso-limited-conversions Prevents a conversion from being counted more than once within a defined timeframe When the user encounters a conversion shortcode that includes the ‘do_once_per’ parameter Preferences & Functional Set by the site admin - How does If-So handle personal data (GDPR)?
If-So processes the personal data that is collected through the plug-in as a data processor on your behalf and in accordance with our Data Processing Addendum.
As such, you (the data controller) are responsible for providing your end-users with a proper privacy notice that covers your use of the If-So plug-in & cookies.
- Where can I find If-So’s Data Processing Addendum (DPA)?
Click here for our Data Processing Addendum (DPA).