Skip to content
Home » double dash

double dash

Visit Tacticalware.com for information related to this tag and others. We look forward to assisting in your tech projects with our in-depth knowledgebase…

WORDPRESS DOUBLE DASH ISSUE 2021 [SOLVED]

  • General

The dreaded double dash issue is back in wordpress. This issue is where wordpress automatically reformats two dashes, into a single long dash. It needs to be removed in blogs like this ome, where many of the commands you see are infact double dashes. This is the quick fix for it.

Login into your site

Go to: Dashboard

Click Appearance

Select Theme Editor

Choose functions.php

Scroll to the bottom of the page and paste

add_filter( ‘run_wptexturize’, ‘__return_false’ );

Click Update

The issue is fixed

Make sure the ‘ symbol above is correct, if it is the apostrophe that slants forward it will not work. it has to the be the apostrophe character that is straight up/down

You will probably need to do this everytime you update your wordpress theme. So bookmark this page and come back when you need to fix it next time.

WordPress Double Dash Issue

  • General

Removing Code to Enable Double Dashes in WordPress

WordPress, by default, changes the code you place into posts and merges items like “–” into “-” so articles don’t show properly. To fix this error do the following:

Modify your site’s wp-includes/formatting.php file

***Make a Backup Copy of this file before you modify it, so you can roll back if it doesnt work***

Remove the following lines:

// Dashes and spaces
$dynamic[‘/—/’] = $em_dash;
$dynamic[ ‘/(?<=^|’ . $spaces . ‘)–(?=$|’ . $spaces . ‘)/’ ] = $em_dash;
$dynamic[‘/(?<!xn)–/’] = $en_dash;
$dynamic[ ‘/(?<=^|’ . $spaces . ‘)-(?=$|’ . $spaces . ‘)/’ ] = $en_dash;
$dynamic_characters[‘dash’] = array_keys( $dynamic );
$dynamic_replacements[‘dash’] = array_values( $dynamic );

Save the file

Now browse to the pages on your website and refresh the page/pages that had the issue. You should now see the Double Dash “–“