1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to strip all links from posts and comments in wordpress?

Discussion in 'Blogging' started by YAH00, Jun 3, 2011.

  1. YAH00

    YAH00 Registered Member

    Joined:
    Apr 29, 2009
    Messages:
    93
    Likes Received:
    3
    Home Page:
    how to strip all links from posts and comments in wordpress?just like the wprobot do.but i don't want to use it.any plugins or code?thanks:)
     
  2. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    950
    Likes Received:
    662
    Occupation:
    Web/Bot Developer
    try this:
    Code:
    $new_string=preg_replace ("/<a.*>/i","",$string);
     
  3. artfuldodger

    artfuldodger Registered Member

    Joined:
    Nov 25, 2008
    Messages:
    91
    Likes Received:
    24
    You can place this in functions.php

    HTML:
    remove_filter('comment_text', 'make_clickable', 9);
    it will remove the default wordpress action
     
  4. YAH00

    YAH00 Registered Member

    Joined:
    Apr 29, 2009
    Messages:
    93
    Likes Received:
    3
    Home Page:
    which file can i place this code?:)