Navigation Guide


Understanding WordPress Auto-Conversions

Our long-time favorite Content Management System (CMS), WordPress, is pretty intelligent since it’ll do some of the heavy lifting in the markup department for you. Meaning that instead of you having to apply some markup in your posts and pages, WordPress will do it for you. This article will explore these conversions, and effectively offer you a resource for the future that you can refer to in case you forget these secrets.

Paragraphs and Breaks

Outside of the WordPress environment — when writing HTML — you have to use paragraph tags (paragraph elements) to form proper paragraphs. Like this:

<p>This is an example paragraph.</p>

<p>This is a second example paragraph.</p>

Within the WordPress environment, you don’t need to use the opening (<p>) and closing (</p>) p-tags since WordPress will do it for you. All you have to do, as the author, is to create an empty new line between your paragraphs. Like this:

This is an example paragraph.

This is a second example paragraph.

That’s it. WordPress will sense this empty new line and apply the tags to the preceding and following blocks for you. This is the best practice, but there is the break option. If you create two bodies of text without the empty new line, WordPress will input a break element. Doing this via HTML markup you’d do this:

<p>This is an example line of text.<br />
   This is a second example line of text.</p>

To make this with WordPress, you just need to create a new line and WordPress will insert the break element, <br />, for you:

This is an example line of text.
This is a second example line of text.

Please bear in mind that breaks have limited usage. When the text is enlarged, the lines will wrap poorly. Also, don’t use them to make a new line so as to make what looks like a list, etc. To learn more about these elements, using lists and breaks, please see these Beast-Blog articles.

Character Entities

Writing paragraph tags, while helpful, isn’t a huge time saver, but it’s not all WordPress will do for you. WordPress also converts certain symbols and typographer’s marks into safe-to-use character entities. For example:

  • Two hyphens, --, will create a proper n-dash (&#8211;): –
  • Three hyphens, ---, will create a proper m-dash (&#8212;): —
  • Three periods, ..., will create a proper ellipses (&#8230;): …
  • A leading apostrophe, ', will create a leading apostrophe (&#8216;): ‘
  • A trailing apostrophe, ', will create a trailing apostrophe (&#8217;): ’
  • A leading quote, ", will create a leading quote (&#8220;): “
  • A trailing quote, ", will create a trailing quote (&#8221;): ”
  • An ampersand, &, will create an ampersand (&#038;): &

Here’s an example. If you write this:

'Tis today's example --- "markup" example, that is...

WordPress will make this:

<p>&#8216;Tis today&#8217;s example &#8212; &#8220;markup&#8221; example, that is&#8230;</p>

Which will look like this:

‘Tis today’s example — “markup” example, that is…

Pretty simple, right? Notice the fancy typographer’s marks the character entities will create. The ellipses, for example, is a single character which cannot be broken by a simple line wrap. Same goes for the m-dash. Notice how attractive the slanted fancy characters are compared to the straight up-and-down plain text marks. Bear in mind, though, there can be a downside.

A Quick Warning

If you don’t do your initial text composition in WordPress preferring to write in something like Word, you must be sure to not copy and paste already converted characters into WordPress. In other words, if your Word document converts the characters already, they will need to be reverted before being pasted into WordPress (a simple find-and-replace exercise will address this). The reason is WordPress can only recognize the plain text characters, not fancy ones. If you fail to heed this warning it is likely you will never notice, but some of your visitors — depending on their character set support — may see other, placeholder characters. For instance, a quoted word may look like “this” to you, but may look like ?this? to some of your visitors.

Happy converting.



[ Top ]