WPLocation

Country-aware content for WordPress

  • Features
  • Demo
  • Add-ons
  • Pricing
  • Blog
  • Account
  • Get WPLocation
← All documentation/Use the Country visibility block
Free

Use the Country visibility block

For the current website releases: Free 1.1.4 and Pro 1.4.0.

On this page
  1. Add a country-specific section
  2. What appears for visitors
  3. Test the finished page
Free setupPro & licensingMy account & downloads

Use a page or post rule when the entire URL should change by country. Use the Country visibility block when only a section within the content should vary. The block is included in Free 1.1.0 and is rendered by WordPress on the server.

Add a country-specific section

  1. Edit a page or post in the WordPress block editor.
  2. Add the Country visibility block from the block inserter.
  3. Choose Only in selected countries or Except in selected countries.
  4. Enter country codes or names separated by commas, such as US, Pakistan.
  5. Add the content inside the block, then save and preview the page.

What appears for visitors

The section renders only when the detected country matches the saved selection and mode. If no countries are entered, or the visitor’s country is unknown, the section is hidden. Surrounding page content still renders unless a separate page or post rule blocks the whole URL.

Test the finished page

Confirm the local database is readable in WPLocation → Diagnostics. Test an allowed and denied country, then purge and inspect your page and CDN caches. A full-page cache can reuse one rendered result for another visitor. For classic-editor content or text-based snippets, use the shortcode guide instead.

Do not put secrets, paid files or confidential data inside a country block. Hiding rendered content by IP location is personalization, not access control.

Where to next?

Choose the right country rule →Check your cache and CDN →Browse all guides →
Need help with this guide?

Contact WPLocation with your software versions and the result you expected. Keep keys and customer data private.

Company

  • About us
  • Contact
  • Terms & Conditions
  • Privacy Policy

Product

  • Features
  • WPLocation Pro
  • Pricing
  • Add-ons roadmap
  • Get WPLocation

Resources

  • Blog
  • Documentation
  • Installation
  • Shortcodes
  • Changelog

Account & Support

  • My Account & Licenses
  • Contact Support
  • Blocked-content behavior

Copyright © 2026. WPLocation is a project of TechAbout LLC.
Questions? [email protected]