we're currently working on an extension for the Yoast-SEO WordPress-Plugin. One of the features of this extension requires the meta-description within the Yoast-SEO-area to be replaced via JavaScript or jQuery. With our code we have replaced the content of the div-container and also changed the content of the hidden input-field. The only problem we have is that the Yoast-plugin shows an error-message if the user tries to change the content added to the div-container.

It seems like the Yoast-plugin stores the content of the meta-description in some other place (maybe a variable!?) as well which then causes the error of we replace the content of the div and the hidden-input. Does anybody have any experience with this issue? Any help would be greatly appreciated. Thanks in advance!

1 Answer 1


It sounds like Yoast-SEO is using some internal data structure to store the meta-description in addition to the visible div and hidden input field. This would explain why the plugin is showing an error message when you replace the content of the div and input field.

To resolve this issue, you may need to investigate the Yoast-SEO plugin's code to determine how it is storing and validating the meta-description. It's possible that there is a specific function or data structure that you need to use to properly update the meta-description.

Alternatively, you could try triggering the update functionality of Yoast-SEO directly rather than trying to replace the content of the div and input field. This could involve calling a specific function or triggering an event that Yoast-SEO uses to update the meta-description.

Without more specific information on how the Yoast-SEO plugin works, it's difficult to provide a more detailed solution. If you are having trouble resolving the issue, you may want to reach out to the Yoast-SEO support team or community for assistance.

  • Thank you for your response. So far I haven't been able to find the functions to make this work. I reached out to the plugin support but they only referred me to the developer-portal which didn't get me much further either. I will continue searching for a solution. If I find one I will post it here.
    – Dennis
    Commented Apr 25, 2023 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.