This one has me baffled.

I'd like to show some content based on the Global variable IP Address. But none of these work:

{if {ip_address} !=}SHOW THIS{/if}


{if {ip_address} != ''}SHOW THIS{/if}


{if '{ip_address}' != ''}SHOW THIS{/if}

I would expect at least the last conditional to work. Is this a parsing issue?

  • Thank Low and Bhahkar. Low; I should have referred to your Parse List PDF, I've got it tucked away somewhere. I thought it might be something like that. Commented Mar 15, 2013 at 23:10

3 Answers 3


The variable {ip_address} is one of the standard global variables that is parsed last, even after advanced conditionals. That means you can't use it in a conditional.

You can use Mo’ Variables (or Low Variables if you’re already using it) to have {logged_in_ip_address} available as an early parsed var, so you can use it in conditionals.


As EE parses {ip_address} after advanced conditionals it easy enough to get that data parsed sooner. I haven't got Low Variables installed on this site otherwise I would use it.

Instead you could add it as a variable to config.php:

$config['ipaddress'] = $_SERVER['REMOTE_ADDR'];

Or I've actually added to my bootstrap file but it achieves the same thing.

  • Elliot Lewis - This worked perfectly: $config['ipaddress'] = $_SERVER['REMOTE_ADDR']; Added to Config.php file and all is well. Thank you!
    – user2619
    Commented Jan 16, 2014 at 14:53

This standard global variable should work with logged in member. See here http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html#ip-address

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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