When I type an ellipsis composed of three separate dots ..., WordPress displays the pre-composed triple-dot glyph instead.

Is there any way to prevent WordPress from substitution the three dots?

  • Just out of curiosity: Where do you need three dots? – fuxia Mar 12 '12 at 3:42
  • Just out of personal preference... There are also several style guides that recommend ... instead of The ellipsis character did not exist before the advent of computers and in my humble opinion should not be used outside of a few specific use cases. – Philip Seyfi Mar 12 '12 at 19:51
  • How wide an ellipsis is depends on the font. Semantically it is one character, hence the separate Unicode code point U+2026. It is also easier for automatic translation tools and screen readers if you use the special character. – fuxia Mar 12 '12 at 19:57

Three dots are converted to the typographically correct ellipsis … in wptexturize(). You can disable it in many cases, see my plugin Disable Wptexturize.

| improve this answer | |

That conversion - among others - is caused by the wptexturize() filter being applied to the_content().

The sledge-hammer approach to preventing wp_texturize() being applied to the_content() is simply to remove the filter, like so:

remove_filter( 'the_content', 'wptexturize' );
| improve this answer | |

Another option is to use the plugin wp-Typography, which can override WordPress's native character replacements. If you disable the changes you don't want in the plugin, they won't show up in the front-end anymore.

| improve this answer | |

Instead of removing the entire wptexturize filter, I think a better approach to this issue is to let wptexturize() run and then undo the replaced ellipsis glyph with the three dots.

The filter is run at a priority of 11 so that it runs after wptexturize().

function wpse_45245_the_content( $content )
  return str_replace( '&#8230;', '...', $content );
add_filter( 'the_content', 'wpse_45245_the_content', 11 );

Note that this only replaces it in the_content filter, if you want it replaced in the_excerpt, the_title, etc., then you'll need to add those filters as well.

| improve this answer | |

Several possibilities, based on the use of a shortcode called '...' (Yes, that's a legal shortcode name.)

  • Exempt the shortcode via the no_texturize_shortcodes filter.
  • Have the shortcode wrap the three period characters with a <code> tag (which is by default exempted from texturizing, so no filter is needed).
  • Similar to the above, but wrap it in a <span>, and use CSS to have it rendered in a font with an ellipsis character whose look you prefer (would need the filter this way).
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.