Thursday , January 7 2021
Home > Wordpress > How To Show Visitors IP Address In WordPress Without Any Plugin

How To Show Visitors IP Address In WordPress Without Any Plugin

Today I Tell You How To Make Your Blog As a IP Detection Blog/Website. In This Way Your All Visitors Will See Their IP Address In Your Blog.

Please Copy The Below Code And Paste In Your Theme function.php File.

// Display User IP in WordPress

function get_the_user_ip() {
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
//check ip from share internet
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
//to check ip is pass from proxy
} else {
return apply_filters( 'wpb_get_ip', $ip );

add_shortcode('show_ip', 'get_the_user_ip');

Next Is Please Put The Below Shortcode In Your Post, Page OR Sidebar Widget Where You Want To Show Your Visitors IP Address.


If You Are Use The Shortcode In Sidebar Widget And You Are Not See Any IP Address. Then Please Make Sure That You Are Enable Shortcode For Your Sidebar Widget.

Must Read: How To Create Password Protected Post In WordPress

Please Enable Your Sidebar Widget For Shortcodes By Paste The Below Code In Your Theme function.php

add_filter('widget_text', 'do_shortcode');

Check Also

How To Write a Full SEO Optimized Post In WordPress

As You Know WordPress Is a Best Platform For Bloggers and Thousands Of  Bloggers Use …

1 Comment
Inline Feedbacks
View all comments
woolrich salg
woolrich salg
6 years ago

It’s very sіmple to find out any topic on web as compared to books, aas
I found tɦis post at this web page.

Would love your thoughts, please comment.x