HTML5 Summary tag in editor

by Will   Last Updated December 09, 2017 01:08 AM

I'd like to use the summary tag to summarise the content of a post, but I'm facing a couple of issues doing that:

  1. There isn't an option for it in the wysiwyg - how can I add elements to the format dropdown?

  2. Wordpress strips out the element when the editor loads, so saving the page again removes the tag. How can I whitelist <summary>?



Answers 1


You can use the $allowed_tags global. Add the following to your functions.php file.

global $allowedtags;
$allowedtags['summary'] = array('class' => array());

Add more attributes within the array similar to the class element. You can learn more on Otto's post here:

Brian Fegter
Brian Fegter
January 08, 2013 05:44 AM

Related Questions