Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Advanced Excerpt Plugin not stripping tags WordPress

  • SOLVED

I'm using the advanced excerpt plugin, because I need various style excepts around my site.

[[LINK href="http://wordpress.org/extend/plugins/advanced-excerpt/"]]http://wordpress.org/extend/plugins/advanced-excerpt/[[/LINK]]

Very simple and straight forward implementation.

In the FAQ section it explains that you can remove all tags, and even specified tags. In my admin settings I've set it up so does not include any tags. [[LINK href="http://i.imgur.com/Sms0y.png"]]See this screenshot.[[/LINK]]

Then on my theme files inside my loops, this is what I added in...


<?php the_advanced_excerpt('length=10&use_words=1&no_custom=1&ellipsis=%26hellip;&read_more=view page&add_link=1'); ?>


The above code was not excluding tags, so I tried this below by adding 'exclude tags'...


<?php the_advanced_excerpt('length=10&use_words=1&no_custom=1&ellipsis=%26hellip;&read_more=view page&add_link=1&exclude_tags=img,p,strong,br'); ?>


and it's still continues to add tags! <p> and <br /> are still appearing in my excerpt.

I thought at first this maybe because I was using wordpress 3.1 - but I've updated the latest update of wordpress of 3.3.1 and it still pulls in tags into my except.

Talk about baking my noodle! Has anyone used this plugin before or had any issues with it?

Can't find an answer anywhere :(

Thanks

Answers (4)

2012-01-09

Arnav Joy answers:

try adding this in your functions.php

remove_filter( 'the_excerpt', 'wpautop' );


Josh Cranwell comments:

Bingo, this worked thanks


Arnav Joy comments:

I am happy!!!

2012-01-09

Manoj Raj answers:

This is the problem with the latest version 4.1.1 of advanced excerpt plugin and a small hack is provided by the plugin author(i think so).. It worked for me at least..

Add this to your functions.php

<?php
remove_all_filters('the_excerpt');


Josh Cranwell comments:

This worked, thanks again Manoj!

2012-01-09

Julio Potier answers:

Hello test this :

<?php the_advanced_excerpt('length=10&use_words=1&no_custom=1&ellipsis=%26hellip;&read_more=view page&add_link=1&exclude_tags[]=img&exclude_tags[]=p&exclude_tags[]=strong&exclude_tags[]=br'); ?>

See you soon


Josh Cranwell comments:

Hi Julio,

Tested you method, the except outputted ok still but still didnt remove any tags. The remove filter ideas below worked ok.

Thanks

2012-01-09

Francisco Javier Carazo Gil answers:

Hi Josh,

You are using a white space into function call. Have you tried change it by "&20".


Josh Cranwell comments:

It was a good thought but still outputted tags. The above filters worked. Thanks


Josh Cranwell comments:

It was a good thought but still outputted tags. The above filters worked. Thanks