Do you want it to not even record, or do you just not want the IP address displayed there?
If you don’t want any comment IP stored I think the following plugin will work. Save what follows as noip.php
and upload it to your plugins directory.
<?php
/*
Plugin Name: No-IP
Plugin URI: http://wordpress.org/support/topic/37363
Description: Causes WordPress to NOT save the IP address from ANY commenter. WordPress will instead record all comment IP addresses as '127.0.0.1'
Author: WP-Forums
Author URI: http://wordpress.org/support/
Version: 0.1
*/
function zap_ip($ip) {
return '127.0.0.1';
}
add_filter('pre_comment_user_ip', 'zap_ip');
?>
EDIT: I do not know if this will have any impact on other WP functionality. It might be better if you chose instead to not display the comment IPs in Manage->Comments. I can tell you how to do that too.
To hide the IP addresses, but still record them, try this plugin instead. It’s not pretty, but it should work.
<?php
/*
Plugin Name: Hide IP in Admin
Plugin URI: http://wordpress.org/support/topic/37363
Description: This plugin will prevent Comment IP addresses from being displayed in your admin panels.
Author: WP-Forums
Author URI: http://wordpress.org/support/
Version: 0.1
*/
function hide_ip($ip) {
return ( strstr($_SERVER['PHP_SELF'], 'wp-admin/') ) ? 'hidden' : $ip;
}
add_filter('get_comment_author_IP', 'hide_ip');
?>
Thread Starter
Enon
(@tyukc1)
thanks mdawaffe I will use either one of these. I might opt to not record IPs at all.
Thank you
Would I save the following plugin code, Hide IP in Admin, as noip.php and upload it to my plugins folder?
<?php
/*
Plugin Name: Hide IP in Admin
Plugin URI: http://wordpress.org/support/topic/37363
Description: This plugin will prevent Comment IP addresses from being displayed in your admin panels.
Author: WP-Forums
Author URI: http://wordpress.org/support/
Version: 0.1
*/
function hide_ip($ip) {
return ( strstr($_SERVER[‘PHP_SELF’], ‘wp-admin/’) ) ? ‘hidden’ : $ip;
}
add_filter(‘get_comment_author_IP’, ‘hide_ip’);
?>
Yes. Save it as say “no-ip.php” in a text editor like notepad. And make sure there are no additional lines before <?php
and after ?>
— which can cause issues for php-only files.
note that nuking the IP could affect the ability for anti-spam plugins to work… Hiding them is much better. It also allows you to go back and see IPs when you get spammed, in case you want to actually hard-block a particular IP from access.
-d
if i send mail to some one and i wont that person to know my ip adress is that possilbe?for exmp. i wanna send from gmailto hotmail and at same time i wont that person to see my ip ….