WordPress.org

Ready to get started?Download WordPress

Forums

Disable recording of IPs in posts (8 posts)

  1. Enon
    Member
    Posted 8 years ago #

    Right now going in the Manage/Comments there's IP address of every poster. I'd like to only have the Name:...... and not record posters' IP addy

    is it possible/

  2. Michael Adams (mdawaffe)
    Member
    Posted 8 years ago #

    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.

  3. Michael Adams (mdawaffe)
    Member
    Posted 8 years ago #

    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');
    ?>

  4. Enon
    Member
    Posted 8 years ago #

    thanks mdawaffe I will use either one of these. I might opt to not record IPs at all.

    Thank you

  5. tedtalk
    Member
    Posted 8 years ago #

    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');
    ?>

  6. Kafkaesqui

    Posted 8 years ago #

    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.

  7. davidchait
    Member
    Posted 8 years ago #

    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

  8. zadd
    Member
    Posted 8 years ago #

    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 ....

Topic Closed

This topic has been closed to new replies.

About this Topic