• Resolved nerdburglars

    (@nerdburglars)


    I was having some trouble where a content filter was being called 3 times. I narrowed it down to the Yoast SEO plugin. I rely quite heavily on this plugin and dont want to remove it, but if its calling “the_content” 2 times with the 3rd being the main call, i cant continue to use it.

    A simple action like the one below will show that the filter is being called 3 times each time the page loads. It will appear once in the body of the post and 2 times in the head of the page. When i deactivate Yoast, the echo will only show up in the post body.

    add_action( 'the_content', 'outputsomething');
    function outputsomething()
    {
    	echo "test";
    }

    This is a serious issue that has me quite worried about how much damage this plugin is going to do to sites as they grow larger. Anyone know whats going on here?

    https://www.ads-software.com/plugins/wordpress-seo/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Nerdburglars,

    YOAST only calls the “the_content” when you does not have written any meta description in the post. So, YOAST tries to create a meta description by using your content. That’s you are seeing this 3 times.

    GO to any post and insert the meta in that post. Then, view the post so, you don’t get repetition of “the_content

    Thread Starter nerdburglars

    (@nerdburglars)

    the post has a meta description so this cant be the cause. Even if it was, this seems like an incredibly wasteful way to do this.

    Nerdburglars, Please share any link where you are facing this issue.

    Thread Starter nerdburglars

    (@nerdburglars)

    I cannot give you access to the back end and there is very little that can be done to debug this from the front end. I make sure to write a Meta description for every page. As I mentioned calling the_content is an expensive action. The developer of the plugin surely knows better than to do something this wasteful to generate a simple meta tag.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin Calling Content Filters 3 times’ is closed to new replies.