<p>Luke Holder has created a plugin that would help you in this situation.</p>

<p><a href="https://github.com/lukeholder/craft-geo" rel="nofollow">Geo Plugin for Craft CMS</a></p>

CC BY-SA 3.0
2015-10-13T08:22:39.230Z
2015-10-13T08:22:39.230Z
John Moylan
<p>I realise this is an old post, but it's something we've tackled recently and wanted to put out our solution.</p>

<p>If you're using CloudFlare you could use our <a href="https://github.com/madebymutual/Country-Detect" rel="nofollow noreferrer">Country Detect</a> plugin, otherwise as John Moylan mentioned <a href="https://github.com/lukeholder/craft-geo" rel="nofollow noreferrer">Luke Holder's Geo Plugin</a> can achieve the same thing. The only advantage of our plugin is that it saves a bit of processing if you're already using CloudFlare.</p>

<p>You could then conditionally show content to US folks only at by something like this...</p>

<pre><code>{% if craft.countryDetect.country == "US" %}
    {# Put your FAQs for USA here #}
{% elseif %}
    {# Content or redirect() goes here #}
{% endif %}
</code></pre>

CC BY-SA 3.0
2017-03-11T15:10:25.833Z
2017-03-11T15:10:25.833Z
Mutual
<p>Is it possible to restrict access to a page based on a visitor's country? </p>

<p>For instance, only users in the US can view the FAQ page? </p>

<p>Thanks!</p>

<security>
Is it possible to restrict access to a page based on a visitor's country?
# Is it possible to restrict access to a page based on a visitor's country?

(Asked by: username_0 on 2015-10-12)

Is it possible to restrict access to a page based on a visitor's country?

For instance, only users in the US can view the FAQ page?

Thanks!

**Tags:** security


---

## 2 answers

### Answer by username_1 on 2015-10-13. Score: 4

Luke Holder has created a plugin that would help you in this situation.

[Geo Plugin for Craft CMS](https://github.com/lukeholder/craft-geo)


---

### Answer by username_2 on 2017-03-11. Score: 1

I realise this is an old post, but it's something we've tackled recently and wanted to put out our solution.
If you're using CloudFlare you could use our Country Detect plugin, otherwise as username_1 mentioned Luke Holder's Geo Plugin can achieve the same thing. The only advantage of our plugin is that it saves a bit of processing if you're already using CloudFlare.
You could then conditionally show content to US folks only at by something like this...
{% if craft.countryDetect.country == "US" %}
    {# Put your FAQs for USA here #}
{% elseif %}
    {# Content or redirect() goes here #}
{% endif %}


---

