CMS

How To Solve Double Dash Problem in WordPress

Today we will solve double dash problem in WordPress.

Are you facing double dash issue in WordPress post? Double dash gets converted into one longer dash.

To get normal double dash (–) in your content, follow these steps:

Open formatting.php file

Ex.

nano wp-includes/formatting.php

Follow Below lines:

// Dashes and spaces

$dynamic[‘/—/’] = $em_dash;
$dynamic[ ‘/(?<=^|’ . $spaces . ‘)–(?=$|’ . $spaces . ‘)/’ ] = $em_dash;
$dynamic[‘/(?<!xn)–/’] = $en_dash;
$dynamic[ ‘/(?<=^|’ . $spaces . ‘)-(?=$|’ . $spaces . ‘)/’ ] = $en_dash;

And comment those line For Example:

//$dynamic[‘/—/’] = $em_dash;
//$dynamic[ ‘/(?<=^|’ . $spaces . ‘)–(?=$|’ . $spaces . ‘)/’ ] = $em_dash;
//$dynamic[‘/(?<!xn)–/’] = $en_dash;
//$dynamic[ ‘/(?<=^|’ . $spaces . ‘)-(?=$|’ . $spaces . ‘)/’ ] = $en_dash;

Save and close it.

That’s it, now check your content.

Related Articles