Overiding the_excerpt

Greets:

This thread on edublogs got me thinking. Since many theme designers use the_excerpt on their category, date, monthly and tag pages, that will throw folks off as they;re expecting to see the entire content. (Not to single out the thread on edublogs or the poster. I could point at dozens of threads on wp.com.)

Now from an SEO position, using the_excerpt on those pages is a good idea so not to have an excess of dupe content. On the other hand, displaying full content is a better idea as noted in the edublogs thread on occasion.

Editing every theme isn;t gong to happen and there's no easy way to make a switch to go back and forth.

Is there an easy way to create a filter within a plugin or other method to tell wp to use the full content of the Post within the_excerpt?

  • Tammie

    @drmike: The excerpt is useful for search, archive and category just from a search / find point of view if you had a search or archive page showing entire posts that wouldn't be as usable at all. You can change the excerpt length via filters though so set it to something silly and voila excerpt = content.

    http://codex.wordpress.org/Template_Tags/the_excerpt

    Scroll down the bottom to find your function to do that. I'd still say anything beyond the single page is a bad idea from a 'get information without scrolling / clicking next until your finger drops off' :slight_smile: I tend to see things more from a usability view than a SEO point of view really with my designery head on.

  • drmike

    The excerpt is useful for search, archive and category just from a search / find point of view if you had a search or archive page showing entire posts that wouldn't be as usable at all.

    I understand that and I believe I said something to that effect in my first post as well as the edublog's thread. As in that edublog's thread, what is causing an issue though is the stripping of the links and the embedding images. From the teacher's point of view, where SEO is actually at the bottom of their needs list and usability is to the top, removing the stripping is understandable. A second grader is only going to want to see their pictures of their missing teeth from their smiling faces, not what's outputted from the_excerpt.

    Setting the length isn't going to solve the issue as we're looking at the stripping, not the length here of the passage.

    I believe removing the filter within an optional plugin may work. I was wondering if I was going at this the right way.

    edit: I suck at hooks and filters if you haven't noticed. That's why I was asking.

  • Richie_KS

    definately a topic need to discuss...like sue mention to me last week.

    some user that use theme for photoblog are tend to do not want excerpt for their
    post..in the other hand some user like to add their own <!-- more --> to their long post
    and on the other long hand:slight_smile: some user tend to side with SEO..that would be full post
    in index/home and excerpt in archive page.

    a simple theme option in each theme can take care of this but the plugin suggestion
    definately better..something can be drop to mu-plugins...anyone want to take a shot..

  • drmike

    I was hesitant to suggest it as a theme option as it would require a rewrite of each and every theme. And probably not just for one page within the theme either.

    As far as I understand it, just removing the filter in question seems to be the simplest way to go with a plugin in the regular plugins subdirectory that can be turned on or off at the user's whim.

    Unless of course you want to make the choice down at Post level. I'd go the custom options method with that. That's what I looked at first.