//[nbsp] shortcode
function nbsp_shortcode( $atts, $content = null ) {
$content=" ";
return $content;
}
add_shortcode( 'nbsp', 'nbsp_shortcode' );
Then call it like this:
[nbsp]
Instead of:
Hat tip to this post on wordpress.org: https://wordpress.org/support/topic/prevent-nbsp-characters-from-getting-removed-by-the-visual-editor
Related Posts:
- Switch between Visual and HTML tab freely
- Add popup window to TinyMCE buttons
- How to customize TinyMCE4 in WP 3.9 – the old way for styles and formats doesn’t work anymore
- Removing buttons from the editor
- How to use tinyMCE for user “biographical info”?
- TinyMCE 4.x : How to customize toolbar on wp_editor()
- 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”
- Second toolbar in tinymce has “display:none” set?
- Add Shortcode inline inside Gutenberg block
- Using post ID in custom tinyMCE button
- How to make WordPress and TinyMCE accept tags wrapping block-level elements as allowed in HTML5?
- 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
- Visual Editor freezing on text highlight since 4.3
- Remove ‘Visual’ tab from TinyMCE editor
- Remove empty lines ( ) when author updates their post
- 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
- How do i disable/disallow and tags in TinyMCE?
- Deprecated TinyMCE API call: windowManager.createInstance(..)
- Text cut off after the character 𪇆 in TinyMCE
- 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
- How can I control the HTML output of my post?
- 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
- Is there a way to remove the default css from TinyMCE?
- Add Wrapper with Class to WYSIWYG Editor
- Make Textarea a TinyMCE (editor box)
- How to remove the statusbar from the default wordpress editor?
- TinyMCE Visual Blocks plugin set Show blocks option for all users
- 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
- Can’t remove generated by editor from database
- Custom TinyMCE style formats disabled
- Editor stripping out data attribute when saving
- 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
- Open Insert/edit link popup
- Use schema.org HTML in TinyMCE Editor
- Change syntax styling of TinyMCE HTML Text Editor
- More than one TinyMCE (wp_editor) with different $settings[‘drag_drop_upload’] values breaks
- How to add Listbox / Select dropdown for shortcodes in WP 3.9 beta2 using TinyMCE?
- Using spellchecker plugin in TinyMCE
- Customer Support: TinyMCE stopped working (on some computers)
- TinyMCE buttons that launch Ajax-generated forms
- Stop TinyMCE from deleting empty HTML tags
- 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?
- 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
- Overriding TinyMCE buttons – Justify button shortcodes not working
- Customizing tinyMCE 4 Styles and Format dropdowns
- WordPress (TinyMCE) not removing script tags
- Why Editor reformats my code
- TinyMCE invalid nested list markup
- Unable to save Theme Options when TinyMCE is enabled for the text area
- 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?
- 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
- Preserve indentation, HTML5 shorthand in editor
- Remove MS Word comments from pasted text
- Prevent Black Studio TinyMCE from adding tags when switching from Visual to HTML mode
- How to have html in TinyMce “Text” tab properly indented and highlighted
- TinyMCE adds a after a HR
- TinyMce Chrome newline issue
- Inline Editing with wp_editor and tinymce (problem with textarea)
- Custom shortcode editor [BackboneJS & TinyMCE)
- What is zinging my HTML commands? I don’t think I can blame TinyMCE this time…
- Preventing tinyMCE from auto formatting selected blocks of content
- Is there an alternative way to upload html without using TinyMCE?
- Add new MCE button for toggle specific cell background color