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
- Edit a page or post in the WordPress block editor.
- Add the Country visibility block from the block inserter.
- Choose Only in selected countries or Except in selected countries.
- Enter country codes or names separated by commas, such as
US, Pakistan. - 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.
Contact WPLocation with your software versions and the result you expected. Keep keys and customer data private.
