[wp-hackers] how to avoid [shortcodes] appearing in search link results?

Nathaniel Taintor goldenapplesdesign at gmail.com
Thu Oct 28 22:00:39 UTC 2010


Are you talking about the results returned by your search.php template, or
the results that show up in Google?

If its your internal search - ie search.php results - a simple the_excerpt()
or apply_filters( 'the_excerpt', $your_excerpt ) in the right place should
do what you want and strip out shortcode tags.

If its the descriptions that are showing up in search engines, then check
the meta description tag in your header template file. Most likely you're
accessing $post->post_content directly, which is dangerous in meta content.
Use the_excerpt() there as well, for filter it in some way.

In any case, I don't think this is the right place for this question... Try
the support forums, and give some examples of the code you're working with
and the results you're getting, and you should be able to get a good
answer...


Nathaniel Taintor, Designer/Developer
*Golden Apples Design*
http://goldenapplesdesign.com

@GoldenApples | 503.877.2880
goldenapplesdesign at gmail.com



On Thu, Oct 28, 2010 at 4:55 AM, 24/7 <24-7 at gmx.net> wrote:

> I currently use a whole set of shortcodes to give the client the
> possibility to style the content as easy as possible. My only problem
> with using shortcodes is that they appear in search engine results as
> plain text.
>
> Ex.
> "Welcome to company XY [logo] blabla [line] [list] bla [/list] bla"
>
> I have thought about this for quite a time now, but i can't imagine
> any way around. Somebody got an idea on how to avoid this?
>
> Thanks!
> - K.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list