Smart quotes to straight quotes
By default, WordPress converts straight quotation marks into curly quotation marks (also called smart quotes). This function makes the quote marks more visually appealing than straight quotes, and helps users see where a quote string begins and ends. However, if programmers cut and paste snippets of code that use smart quotes into another system, they will encounter errors.
To resolve this issue, when you want to use straight quotes with your code, switch to the text editor and begin and end each instance with <tt> HTML tag.
Example
- Text as entered in the visual or text editor: “Curly quotes”
- Rendered content: “Curly quotes”
Notice that in the visual editor, the quotes look the same. However, when published, WordPress formats them as smart quotes.
When you switch to text editor and use the <tt> tags, WordPress renders content as straight quotes.
- Text as entered in the text editor: <tt>”</tt>Straight quotes<tt>”</tt>
- Rendered content: "Straight quotes"
This workaround applies to full- or half-quotation marks.