Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to disable ahref tags in posts?


  • thetalltree
    Member

    @thetalltree

    I would like to disable ahref tags in the forum posts so users cannot add links to external websites within a post. In addition to that, I would also like to stop the automatic phrasing of links. For instance, if someone enters ‘http://www.bbpress.org’ I would like it to appear as plain text instead of a clickable link.

    I made a plugin as mentioned by ‘jonich0n’ in the following post but it is not working:

    How can I disable HTML in posts?

    I uploaded this plugin in my wordpress plugins folder and then activated it from the wordpress ‘installed plugins’ page. Is there where it is supposed to be uploaded?

Viewing 7 replies - 1 through 7 (of 7 total)

  • thetalltree
    Member

    @thetalltree

    I am using version 2.0.2 by the way.


    thetalltree
    Member

    @thetalltree

    Anybody?


    thetalltree
    Member

    @thetalltree

    Still waiting. Would really appreciate a response.

    Ability to disable ahref tags would make it a lot easier to deal with ‘link spammers’ as this would discourage them to add useless replies/posts. So this is really a basic functionality.


    Aahan Krish
    Participant

    @aahan

    @thetalltree : Take a look at the forum index of bbpress.org, and you’ll notice that there are at least 2 spam posts. SPAM! And what’s even more alarming is that they are still there!

    Take my advise, ask elsewhere. (Try asking on wordpress.stackexchange.com)

    My $0.02! :)


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    This forum is staffed by volunteers. The more you bump and complain is the less likely one of our awesome staffers is to help. It moves too slowly here to bump 4 times a day.

    If you decide to post somewhere else, none of us are likely to look there to help.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    To answer your question, you’ll need to put a custom filter on WordPress’s kses. A Google search should help you tremendously. If you’re not a developer or not comfortable diving into the code, you’ll want to spend some time learning, or hire someone to help you.


    thetalltree
    Member

    @thetalltree

    Thanks John for the heads up. This is what I did:

    1.) Open Wp-includes > kses.php

    2.) Find the following:

    $allowedtags = array(

    ‘a’ => array(

    ‘href’ => array (),

    ‘title’ => array ()),

    ‘abbr’ => array(

    ‘title’ => array ()),

    3.) Remove:

    ‘a’ => array(

    ‘href’ => array (),

    ‘title’ => array ()),

    I tried adding // but it does not work, so I removed the tag.

    Not sure if what I have done is the right method, but it seems to work.

    Some more info here:

    https://codex.wordpress.org/Answers-Configuration#Stopping_HTML_in_Comments

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar