[*]
You need to modify the TinyMCE settings, specifically the valid_children
setting. To accomplish this in WordPress, use the tiny_mce_before_init
filter reference.
Something like this (untested):
add_filter('tiny_mce_before_init', 'modify_valid_children');
function modify_valid_children($settings){
$settings['valid_children']="+a[div|p|ul|ol|li|h1|h2|h3|h4|h5|h5|h6]";
return $settings;
}
You may be able to use +a[*] to capture all elements, but you’ll want to take care to avoid nested anchor tags.
[*]
Related Posts:
- TinyMCE editor is breaking my beautiful HTML
- How to make WordPress and TinyMCE accept tags wrapping block-level elements as allowed in HTML5?
- Preserve indentation, HTML5 shorthand in editor
- Switch between Visual and HTML tab freely
- Creating a wp_editor instance with custom tinyMCE buttons
- Removing buttons from the editor
- Load wp_editor via ajax [duplicate]
- How to use tinyMCE for user “biographical info”?
- How i can i add a split button or list box to the WordPress TinyMCE instance
- TinyMCE in customizer
- When switching from html to visual editor the tag gets corrupted
- Markup of oEmbed codes in the editor?
- Cite-Tag for blockquotes
- Secure Validation of wp_editor in Theme Options
- Detecting when TinyMCE is “ready”
- Using a dashicon for a custom button in TinyMCE?
- Second toolbar in tinymce has “display:none” set?
- Integrating inline tinymce editor in a component for a gutenberg block
- Using post ID in custom tinyMCE button
- TinyMCE editor – new lines not rendered on front end
- onClick inside post_content does not appear in post tinymce editor
- How to get WP editors tinyMCE instances
- Remove empty lines ( ) when author updates their post
- Easy way to inject js in tinymce iframe?
- WP 3.3 my rich text category editor toolbar is gone!
- What is this: data-wplink-url-error=”true” and why is it added to my links?
- Customising the WordPress TinyMce editor and it’s buttons
- Deprecated TinyMCE API call: windowManager.createInstance(..)
- wordpress 3.5 tinymce height
- TinyMCE is broken
- Adding image to visual editor popup for shortcode with wp.media and wp.mce: changing image duplicates shortcode
- Change Default Font Size and Remove Unwanted Font Sizes in TinyMCE
- Change TinyMCE Block Format Labels
- Adding Custom Styles to the MCE dropdown toolbar
- TinyMCE Plugin Parameter
- wpeditor issue – shows both mode and not able to focus/edit during visual mode
- How to stop editor removing space ( ) in the beginning of the paragraph
- Add Wrapper with Class to WYSIWYG Editor
- Make Textarea a TinyMCE (editor box)
- How to remove the statusbar from the default wordpress editor?
- wp.editor.initialize does not show the same default toolbar
- Stop WordPress Visual Editor converting backticks into code blocks
- How to add button in TinyMCE TEENY mode?
- TinyMCE Editor change underline button behavior – u tag instead of span text-decoration underline
- Insert dynamic listbox options in Tinymce popup editor
- Selectively remove empty line after line change
- Can’t remove generated by editor from database
- Custom TinyMCE style formats disabled
- Editor stripping out data attribute when saving
- wordpress qtranslate editor text is not working [closed]
- create a front end post page template withTinyMCE,
- TinyMCE function: Remove (earlier) added style from the editor
- TinyMCE custom plugin, how to make a word automatically selected based on current cursor position?
- Avoid glitchy characters – my own version of the problem
- Post content not showing in the edit post textarea
- How to add custom font to TinyMCE FontSelect in WP Admin or filter the fonts available
- Disable TinyMCE Table formatting width/height
- Use schema.org HTML in TinyMCE Editor
- How to dynamically generate wordpress editor on frontend?
- Change syntax styling of TinyMCE HTML Text Editor
- wp_editor not modify html tags of initial content
- Customer Support: TinyMCE stopped working (on some computers)
- TinyMCE buttons that launch Ajax-generated forms
- How can I make the page editor trust me?
- Adding custom block formats to TinyMCE. Everything works until JavaScript error when applying the format
- Adding CSS to admin TinyMCE editor for custom button
- How to disable TinyMce’s Paste plugin from turning image URLs into embedded ?
- How can a TinyMCE modal return formatted/visual text?
- How to apply a custom skin to WP_Editor / TinyMCE?
- Visual composer causing conflict with TinyMCE [closed]
- Blank spaces show as a question mark
- Can i set css class for table via TinyMCE [closed]
- Where’s the explanation of the TinyMCE’s vars in the WP core?
- How to edit blockquote image
- Customizing tinyMCE 4 Styles and Format dropdowns
- WP Editor: Keep Bold, Underline, etc. but ignore color
- TinyMCE 4 & wp_editor multiple editor issue
- WordPress (TinyMCE) not removing script tags
- Why Editor reformats my code
- How to remove buttons from tinyMCE in wp_editor added via AJAX
- How can I remove using built in wordpress filters
- TinyMCE Visual editor removes href containing Javascript with ‘allow_script_urls’ set to true
- TinyMCE is inactive after installation
- How to set custom TinyMCE format style as default?
- Did Gutenberg block editor change the html in post content during import?
- How can I change TinyMCE’s default block format?
- Load WordPress Editor .css on Front End
- “Formats” Select Menu in WP Editor doesn’t show up with correct colour
- Understanding automatic text formatting in the WordPress editor
- Prevent Black Studio TinyMCE from adding tags when switching from Visual to HTML mode
- How to remove “justifyfull” in TinyMCE
- TinyMce Chrome newline issue
- Inline Editing with wp_editor and tinymce (problem with textarea)
- Custom shortcode editor [BackboneJS & TinyMCE)
- Localize tinymce in WordPress 3.9?
- What is zinging my HTML commands? I don’t think I can blame TinyMCE this time…
- Get the More QuickTag button back
- Is there an alternative way to upload html without using TinyMCE?
- Add new MCE button for toggle specific cell background color
- WordPress Started Executing Code Inside PRE Tags Even They Are Properly Escaped