Get A User’s IP Address in WordPress

Avatar

Sometimes you need to know a visitor IP address in your wordpress website. That’s possible to detect and display a user’s IP. Now, you can read this short article that about how to retrieve the IP address and they are able to see their own IP address, of course.

It is a simple way, you can copy the following code snippet below. And you have to paste it in your theme’s functions.php file.

 

After that, you can add the shortcode

on your page, sidebar, or even post.

Here is a demo page about how to display a visitor’s IP address in WordPress.

Leave a Reply

Your email address will not be published. Required fields are marked *