Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author George Notaras

    (@gnotaras)

    Hi Greg,

    The shortcodes should be removed automatically… I’ll look into this as soon as possible, because I’ve also received feedback from another user about such an issue. I’ll need to investigate what the cause could be.

    Thanks for your feedback.

    George

    Plugin Author George Notaras

    (@gnotaras)

    In my tests the shortcodes are removed correctly from the generated descriptions. Could you try to add one of the default WordPress shortcodes, eg [gallery ids="1,2,3,4,5"], and check if the shortcode appears in the description?

    If it still appears, then there might be a bug in the plugin. If not, then there is something wrong with the shortcodes of the aforementioned plugin and perhaps you should contact the developer.

    Add-Meta-Tags uses the WP API (get_shortcode_regex() function) to get a pattern which is used to remove the shortcodes. If that plugin registers its shortcodes in a way that their patterns are not returned by get_shortcode_regex(), then this should be corrected by the other dev.

    Looking forward to your feedback.

    George

    Thread Starter lowegreg

    (@lowegreg)

    George, thanks for the prompt reply. I had a try at adding a default WordPress shortcode and you’re correct your plugin removes them without issue.

    However the WP Bakery Visual Composer tags are not being removed. I will write the author of that plugin and hopefully will get a resolution. in the meant time is there any adjustment I can make to fix the tag?

    Cheers,
    Greg

    Plugin Author George Notaras

    (@gnotaras)

    Hi Greg,

    I’ve received some feedback from another user about a possible case in which the shortcode would not be removed. This is when the whole text of the post is enclosed in the shortcode tags. Is this the case here?

    George

    Plugin Author George Notaras

    (@gnotaras)

    Currently, the only workaround I can provide is the following code, which should be put in the functions.php file of the theme:

    function amt_remove_extra_shortcodes($post_body) {
        return preg_replace('#\[[^\]]+\]#', '', $post_body);
    }
    add_filter('amt_get_the_excerpt_plain_text', 'amt_remove_extra_shortcodes');

    This code removes any extra shortcodes before a description is autogenerated.

    It will eventually make its way in the plugin, but this will happen only after extensive testing.

    Your feedback is welcome and appreciated.

    The code works in my tests, so I’ll mark this topic as resolved. Please, feel free to reopen if it does not work in your environment.

    George

    @george

    The above doesn’t seem to change anything for me. The [] Shortcode shows

    <!-- BEGIN Metadata added by Add-Meta-Tags WordPress plugin -->
    <meta name="description" content="[anspress]..." />
    <!-- END Metadata added by Add-Meta-Tags WordPress plugin -->
    Plugin Author George Notaras

    (@gnotaras)

    @massimod, I’d appreciate it if we continued this discussion on the issue tracker on Github. Please check the sticky announcement on this forum regarding support.

    Thank you in advance and sorry for any inconvenience.

    George

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Description showing [ ] tags from other plugins’ is closed to new replies.