How to remove links from the post content? (3 posts)

  1. iul
    Posted 1 year ago #

    I would like to have no URLs in the content of the posts that are sent by mail (the text would remain as it is but without linking to another page). How do I do that?

    Thank you.

    P.S. this is by far the best newsletter plugin I've seen, so thank you for this too !


  2. Manu-PB
    Posted 1 year ago #

    Tee link is built in the _loop.php file of the theme, inside the <h2> div.

    <a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'twentyten'), the_title_attribute('echo=0') ); ?>" rel="bookmark"  <?php $this->classes('nopmb entry-title_a'); ?>>
    <?php $this->the_title(); ?>

    into :

    <?php $this->the_title(); ?>

    Note : you should do this in a custom theme to avoid losing your modifications by next plugin update.

    [Edit] OUps, I guess it's NOT your question... I leave it anyway, it might help someone else...

  3. Manu-PB
    Posted 1 year ago #


    Maybe have a look at PHP strip_tags, where you must then declare which tags are NOT to be stripped... can be laborious ...

    Also seen :

    $link = str_replace("<a href=\"","",$your_link);
    $link = ereg_replace("\">()</a>","",$link);

    But it will strongly depend on other attributes : title, target, rel, style, ...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.