Geotargeting WordPress Blog

Important news, plugin updates and articles from WordPress community.

How to geotarget tables with the TablePress plugin

In this short tutorial, we show you how to add geolocation to your Tablepress tables to show different ones based on user country. We have many customers that use the Tablepress WordPress plugin to show for example product reviews, some others to show casino bonuses, and some others just to display technical information.

In any case, if you want to show different tables based on countries you could easily do it by wrapping those tables into GeotargetingWP shortcodes like I will show you below.

Let's say you have 3 tables with IDs 1, 2, and 3. 

  • Table with ID=1 it's only meant to be shown in the United States
  • Table with ID=2 it's only meant to be shown in Canada
  • Table with ID=3 it's the default table that will be shown to everyone else

US table

[geot_filter country="US"][table id=1 cache_table_output=false /][/geot_filter]

CA table

[geot_filter country="CA"][table id=2 cache_table_output=false /][/geot_filter]

Everyone else table

[geot_filter exclude_country="US,CA"][table id=3 cache_table_output=false /][/geot_filter]

Tips to consider

So as you can see the setup is pretty straightforward, only a few things need to be considered. The most important is that you need to disable cache in the tables and you do that by passing cache_table_output attribute as false.

Another thing to keep in mind is that when you want to use a default table you simply exclude the countries in which you are showing the personalized tables. You don't need to target all countries, instead you exclude the ones already targeted elsewhere.

We hope this quick tip post it's useful, let us know in the comments what plugins do you use with GeotargetingWP-

Powered by Froala Editor

Check out our WordPress geolocation solutions
to find out everything you can do!

Start your free trial