Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want that visitors out of my country would be redirected to How I can do this in Wordpress?

share|improve this question

migrated from Nov 3 '11 at 14:13

This question came from our site for professional and enthusiast programmers.

1 Answer 1

You could try using:

Send a get with the incoming ip adress and based on the response redirect it to a different part of your website.

$request = new WP_Http;
$result = $request->request( '<your_api_key>&ip=' );

I hope this helps.

share|improve this answer
As an addendum, the OP would want to use the init hook and place the code in that. Also, use wp_redirect() function to redirect the user. –  v0idless Nov 3 '11 at 14:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.