{"id":5119,"date":"2017-12-31T10:12:19","date_gmt":"2017-12-31T15:12:19","guid":{"rendered":"https:\/\/themespress.ca\/?p=5119"},"modified":"2022-10-01T14:44:39","modified_gmt":"2022-10-01T18:44:39","slug":"how-to-hide-a-form-based-on-a-countrys-ip","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/","title":{"rendered":"How To Hide a Form Based on a Country&#8217;s IP"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>With this tutorial, we will show you how to hide things, such as forms, DIV tags or messages, based on the user&#8217;s geolocalisation. In this example, we&#8217;ll hide things if the user is in <strong>Canada<\/strong>.<\/p>\n<p>If the example below we will create a Formidable Form shortcode which will display a form if the user&#8217;s IP is in Canada. Otherwise, we will display a form that says that they cannot fill out the form.<\/p>\n<p>The first condition that we need is to fetch the user&#8217;s IP given that it is mandatory to make our condition work.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<h2 style=\"text-align: left\" class=\"vc_custom_heading vc_do_custom_heading\" >Afficher l\u2019IP du client<\/h2><div id=\"ts-enlighterjs-container-4431608\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-4431608\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">&lt;?php $ip = $_SERVER[&#039;REMOTE_ADDR&#039;]; echo $ip; ?&gt;<\/pre><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>Now we will create a function that will be called by the Json file, a geolocalisation API to get the IP, the country where the user is based. In our condition we will then specify if the user country is Canada, display the form&#8217;s shortcode otherwise display a message.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<h2 style=\"text-align: left\" class=\"vc_custom_heading vc_do_custom_heading\" >Cacher un formulaire si Nom de Pays \u2013 if Show \/ Hide form ip country<\/h2><div id=\"ts-enlighterjs-container-1204761\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-1204761\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">&lt;?php \/\/ Fonction de donn&eacute;es g&eacute;olocalis&eacute;es \nfunction resolveIP($ip) { \n\t\n\t$string = file_get_contents(&quot;https:\/\/ipsidekick.com\/{$ip}&quot;); \n\t$json = json_decode($string); return $json; } \/\/ On retourne la valeur de l&#039;IP en appelant notre fonction \n\t$ip = $_SERVER[&#039;REMOTE_ADDR&#039;]; \n\t$json = resolveIP($ip); \/\/ Si le nom du pays de l&#039;IP client est Canada affiche le formulaire \n\t\n\tif ($json-&gt;country-&gt;name == &#039;Canada&#039;) {\n\t   echo do_shortcode(&#039;[formidable id=3]&#039;);\n\t}\n\t \n\t\/\/ Sinon\n\telse {\n\t\techo &#039;Seules les entreprises au Canada sont accept&eacute;es.&#039;;\n\t} \n}\n?&gt;<\/pre><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>We will do the same function but this time we will replace the country code from row 14:<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<h2 style=\"text-align: left;font-family:Abril Fatface;font-weight:400;font-style:normal\" class=\"vc_custom_heading vc_do_custom_heading\" >How To Hide a Form Based on a Country's IP<\/h2><div id=\"ts-enlighterjs-container-1030738\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-1030738\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">&lt;?php \n\/\/ Fonction de donn&eacute;es g&eacute;olocalis&eacute;es \nfunction resolveIP($ip) { \n\t$string = file_get_contents(&quot;https:\/\/ipsidekick.com\/{$ip}&quot;); \n\t$json = json_decode($string); return $json; } \/\/ On retourne la valeur de l&#039;IP en appelant notre fonction \n\t$ip = $_SERVER[&#039;REMOTE_ADDR&#039;]; \n\t$json = resolveIP($ip); \/\/ Si le code du pays de l&#039;IP client est Canada (CA) affiche le formulaire \n\t\n\tif ($json-&gt;country-&gt;code == &#039;CA&#039;) {\n\t   echo do_shortcode(&#039;[formidable id=3]&#039;);\n\t}\n\t\/\/ Sinon\n\t\n\telse {\n\t    echo &#039;Seules les entreprises au Canada sont accept&eacute;es.&#039;;\n\t} \n}\n?&gt;<\/pre><\/div>\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>You decide which formula better suits your needs.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"With this tutorial, we will show you how to hide things, such as forms, DIV tags or messages, based on the user's geolocalisation. In this example, we'll hide things if<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/\">Read More<\/a><\/div>","protected":false},"author":81,"featured_media":5122,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[320],"class_list":["post-5119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-php-coding"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"This tutorial will show you how to hide forms, DIV tags or messages, based on the user&#039;s geolocalisation.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Daniel\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Themespress - Des tutoriels et ressources WordPress\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How To Hide a Form Based on a Country\u2019s IP - Themespress\" \/>\n\t\t<meta property=\"og:description\" content=\"This tutorial will show you how to hide forms, DIV tags or messages, based on the user&#039;s geolocalisation.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2017-12-31T15:12:19-05:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-10-01T18:44:39-04:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How To Hide a Form Based on a Country\u2019s IP - Themespress\" \/>\n\t\t<meta name=\"twitter:description\" content=\"This tutorial will show you how to hide forms, DIV tags or messages, based on the user&#039;s geolocalisation.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#blogposting\",\"name\":\"How To Hide a Form Based on a Country\\u2019s IP - Themespress\",\"headline\":\"How To Hide a Form Based on a Country&#8217;s IP\",\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/hiding-form-based-on-user-s-ip.jpg\",\"width\":1920,\"height\":893,\"caption\":\"How To Hide a Form Based on a Country's IP\"},\"datePublished\":\"2017-12-31T10:12:19-05:00\",\"dateModified\":\"2022-10-01T14:44:39-04:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#webpage\"},\"articleSection\":\"Tutorials, PHP, Optional\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#listItem\",\"name\":\"How To Hide a Form Based on a Country&#8217;s IP\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"name\":\"Accueil\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#listItem\",\"position\":3,\"name\":\"How To Hide a Form Based on a Country&#8217;s IP\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/\",\"name\":\"Daniel\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Daniel\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#webpage\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/\",\"name\":\"How To Hide a Form Based on a Country\\u2019s IP - Themespress\",\"description\":\"This tutorial will show you how to hide forms, DIV tags or messages, based on the user's geolocalisation.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/hiding-form-based-on-user-s-ip.jpg\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#mainImage\",\"width\":1920,\"height\":893,\"caption\":\"How To Hide a Form Based on a Country's IP\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/how-to-hide-a-form-based-on-a-countrys-ip\\\/#mainImage\"},\"datePublished\":\"2017-12-31T10:12:19-05:00\",\"dateModified\":\"2022-10-01T14:44:39-04:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How To Hide a Form Based on a Country\u2019s IP - Themespress","description":"This tutorial will show you how to hide forms, DIV tags or messages, based on the user's geolocalisation.","canonical_url":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#blogposting","name":"How To Hide a Form Based on a Country\u2019s IP - Themespress","headline":"How To Hide a Form Based on a Country&#8217;s IP","author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2017\/12\/hiding-form-based-on-user-s-ip.jpg","width":1920,"height":893,"caption":"How To Hide a Form Based on a Country's IP"},"datePublished":"2017-12-31T10:12:19-05:00","dateModified":"2022-10-01T14:44:39-04:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#webpage"},"isPartOf":{"@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#webpage"},"articleSection":"Tutorials, PHP, Optional"},{"@type":"BreadcrumbList","@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","position":1,"name":"Accueil","item":"https:\/\/themespress.ca\/en\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","position":2,"name":"Tutorials","item":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#listItem","name":"How To Hide a Form Based on a Country&#8217;s IP"},"previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","name":"Accueil"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#listItem","position":3,"name":"How To Hide a Form Based on a Country&#8217;s IP","previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}}]},{"@type":"Organization","@id":"https:\/\/themespress.ca\/en\/#organization","name":"Themespress","description":"Des tutoriels et ressources WordPress","url":"https:\/\/themespress.ca\/en\/"},{"@type":"Person","@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author","url":"https:\/\/themespress.ca\/en\/author\/daniel\/","name":"Daniel","image":{"@type":"ImageObject","@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g","width":96,"height":96,"caption":"Daniel"}},{"@type":"WebPage","@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#webpage","url":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/","name":"How To Hide a Form Based on a Country\u2019s IP - Themespress","description":"This tutorial will show you how to hide forms, DIV tags or messages, based on the user's geolocalisation.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/themespress.ca\/en\/#website"},"breadcrumb":{"@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#breadcrumblist"},"author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"creator":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2017\/12\/hiding-form-based-on-user-s-ip.jpg","@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#mainImage","width":1920,"height":893,"caption":"How To Hide a Form Based on a Country's IP"},"primaryImageOfPage":{"@id":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/#mainImage"},"datePublished":"2017-12-31T10:12:19-05:00","dateModified":"2022-10-01T14:44:39-04:00"},{"@type":"WebSite","@id":"https:\/\/themespress.ca\/en\/#website","url":"https:\/\/themespress.ca\/en\/","name":"Themespress","description":"Des tutoriels et ressources WordPress","inLanguage":"en-US","publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"}}]},"og:locale":"en_US","og:site_name":"Themespress - Des tutoriels et ressources WordPress","og:type":"article","og:title":"How To Hide a Form Based on a Country\u2019s IP - Themespress","og:description":"This tutorial will show you how to hide forms, DIV tags or messages, based on the user's geolocalisation.","og:url":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/","article:published_time":"2017-12-31T15:12:19-05:00","article:modified_time":"2022-10-01T18:44:39-04:00","twitter:card":"summary","twitter:title":"How To Hide a Form Based on a Country\u2019s IP - Themespress","twitter:description":"This tutorial will show you how to hide forms, DIV tags or messages, based on the user's geolocalisation."},"aioseo_meta_data":{"post_id":"5119","title":null,"description":"This tutorial will show you how to hide forms, DIV tags or messages, based on the user's geolocalisation.","keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-12-04 13:54:19","updated":"2025-06-08 00:10:06","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/\" title=\"Accueil\">Accueil<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/categorie\/tutorials\/\" title=\"Tutorials\">Tutorials<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow To Hide a Form Based on a Country\u2019s IP\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Accueil","link":"https:\/\/themespress.ca\/en\/"},{"label":"Tutorials","link":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/"},{"label":"How To Hide a Form Based on a Country&#8217;s IP","link":"https:\/\/themespress.ca\/en\/how-to-hide-a-form-based-on-a-countrys-ip\/"}],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=5119"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5119\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/5122"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=5119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=5119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=5119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}