Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

It automatically deletes the <script> tag in the description section of the category

I tried to use the category description to add schema to the categories, but it automatically deletes the tag after saving it.

is there a way to prevent this in wordpress

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

after recording;

enter image description here

>Solution :

For security fields like this tend to be sanitized to prevent random scripts from being injected.

You are better off using wp_enqueue_script or wp_head

https://developer.wordpress.org/reference/functions/wp_enqueue_script/

https://developer.wordpress.org/reference/functions/wp_head/

Using wp_enqueue_script you could check against the category and have it add it that way which also makes it so it only shows up within that/those categories.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading