One Response

  1. Rudd
    Rudd Published |


    Just awesome. Never thought of this before.

  2. toscho
    toscho Published |

    The actions loop_start and loop_end are probably safer for this. Don’t think a priority of 0 is a guarantee: negative numbers are allowed, and they will win.

    Shortcodes for use in theme templates.

    There is one exception: Inside of PHP shortcodes are almost always useless. echo do_shortcode('[shortcode_1]'); is a common and expensive mistake, when people forget they can call the shortcode callback just by its name.

  3. Thiago Senna
    Thiago Senna Published |


    I don’t like the idea to hack this kind of thing. As developer I’d like to use shortcodes as my ‘dev tools’ when creating themes (if necessary). It’s a beautiful approach to execute a function within a string content.

    I really prefer to be free when creating shortcodes besides thinking about hacks to avoid bad uses of the shortcode.

  4. Drew Jaynes
    Drew Jaynes Published |

    I’m curious whether this is purely a semantic argument about theme vs plugin functionality.

    Is it the idea that themes shouldn’t influence content only the display of said content? If so, that’s something I can get behind. If not, it seems like such an odd argument to make — no shortcodes in post content — since that’s exactly what shortcodes are for.

    I’d also be curious to hear your stance on what shortcodes’ exit strategy should be, especially when people’s post_content is littered with leftover shortcodes. Personally, I’m kind of a fan of re-adding the shortcode and giving it an empty output.

  5. Sarakuj
    Sarakuj Published |

    iam amazed how you cover that and described in a clean way, thank you

  6. roni rah
    roni rah Published |

    Useful! Specially thanks for the shortcodes.

  7. Maria watson
    Maria watson Published |

    Nice article to cover short codes in word press.. I have been using word press for blogging but never thought of this thing..This looks like more of a techie feedback..would love to follow this blog for more details on Wordpress..

  8. Valentin
    Valentin Published |

    Just awesome, thanks for the tips !

  9. Jason Miller
    Jason Miller Published |

    This is good, solid advice and explained very concisely. Thank you sir

  10. Kajolcute
    Kajolcute Published |

    It’s good ! Useful! Specially thanks for the shortcodes.

  11. How To Disallow Specific Shortcodes in Post Content
  12. Silver
    Silver Published |


    Good idea for your own shortcode, but my problem is mainly about ‘external’ added ones (by themes …). So do you have a solution to list ‘all’ the site shortcodes ?

  13. Wilfried
    Wilfried Published |

    Thank’s Specially thanks for the shortcodes.

  14. Zig
    Zig Published |

    Thanks for the code, but it doesn’t work for me.

  15. Removing shortcodes from post content. | keesiemeijer
  16. Removing specific shortcodes from post content. | keesiemeijer
  17. How to remove specific shortcodes from post content. | keesiemeijer

Comments are closed.