WordPress Quirks for 100, Alex. The key combination for entering a single line break.
What is Shift-Enter?
One of the most common questions that I get from new (and not so new) WordPress users is, how do I get rid of all that extra space between lines? First of all, it’s important to understand what happens behind the scenes when you press the Enter key. In the “classic” WordPress editor, the Enter key creates two line breaks. When WordPress renders HTML, it interprets these line breaks as a paragraph and inserts opening and closing tags.
In the new block editor (Gutenberg), pressing Enter creates a new text block and inserts tags around everything within it. No matter which editor you’re using, these tags will be formatted according to your theme’s style sheet and will almost always include a bottom margin to create a “double space” between paragraphs.
When you don’t want that extra space, use Shift-Enter. This will insert a <br> (break) tag within the paragraph, creating a nice single space line break. See, easy.
Bonus key combination
This one is most useful in the Classic editor. When copying and pasting text from another source, you generally don’t want to bring over all the original formatting. If you paste into the WordPress editor using Ctrl-Shift-V, all of the formatting will be stripped out. It will be just as if you had typed new text into the editor. You’ll have to replace any bold, italics, bulleted lists and links that might have been in the original but this process ensures that your theme styles are used and your formatting remains consistent.
Gutenberg does a much better job of stripping out formatting codes by itself, so you can paste using Ctrl-V and still get nice, clean text without having to do all the manual replacements. Score one for Gutenberg!
Have any stupid WordPress tricks that you use? Leave them in comments below.