• Resolved abzu2

    (@abzu2)


    Would like to know if it is possible to disable WP’s autocorrect function or how to modify the autocorrect options. Fail to find a plugin to facilitate this option. Found “Kih WordPress Auto Correct” which is limited to only correcting wordpress to WordPress. A step in the right direction but somewhat limited.

    Have a problem with WP modifying morse code text to non-valid text,

    ie:
    .-.. — …- .

    however, after accepting the changes it is converted to:

    .-.. — …- .

    the three dashes are converted to a bar and the formatting of three dots in a row is also altered, thus returning an error when converting morse code to text. Have tried various options without any success.

    It should be:
    .-..

    …-
    .

    Fail to see how to resolve this issue.

    TIA

Viewing 11 replies - 1 through 11 (of 11 total)
  • Open up the file formatting.php in the wp-includes folder off your site’s root folder. Line numbers are assuming you are running the latest WordPress version.

    To completely bypass the WordPress “autocorrect” feature, you can change line 33 from:

    $default_no_texturize_tags, $default_no_texturize_shortcodes, $run_texturize = true;

    to

    $default_no_texturize_tags, $default_no_texturize_shortcodes, $run_texturize = false;

    changing $run_texturize to false so that the filter is not applied anywhere at all.

    If you just want to not autocorrect the dots and dashes, do a search for any dot-dash combination you want to stay as is, within that wptexturize function and comment out related code. For example, commenting out ellipses processing in lines 98-99:

    $static_characters = array_merge( array( /* '...', */ '''', '\'\'', ' (tm)' ), $cockney );
    $static_replacements = array_merge( array( /* '…', */ $opening_quote, $closing_quote, ' ?' ), $cockneyreplace );

    and line 176:

    /* $dynamic[ '/---/' ] = $em_dash; */

    Thread Starter abzu2

    (@abzu2)

    Mizagorn

    Thank you very much for your kind reply and suggestions. I opted for the modification of the auto-correction of dots+dashes.

    The original codes for lines 98,99,176 are as follows:

    $static_characters = array_merge( array( '...', '`’, ‘\’\”, ‘ ™’ ), $cockney );
    $static_replacements = array_merge( array( ‘…’, $opening_quote, $closing_quote, ‘ ?’ ), $cockneyreplace );

    $dynamic[ ‘/—/’ ] = $em_dash;
    `

    When I replaced them with your suggestions I was unable to log in to my site. Blank page. Restoring the original code enables me to get my site abzu2.com back up Using a child Elucidate theme to use modifications, don’t know if that could be an issue ??

    TIA

    Hi abzu,

    I’m sorry about the troubles you had with that! It is highly likely that there was a comment area in the above lines that wasn’t put in exactly correctly, which generated an error, causing the site to fuss at you.

    First, just try commenting out *all* of line 176. Only that line. Then see what happens. Make sure you start the line with /* (forward-slash, star, space) and end the line with */ (space, star, forward-slash).

    If that works OK, then, instead of commenting out *sections* of lines 98 & 99, comment out the whole lines (like above) and replace them with this:

    $static_characters = array_merge( array( ‘‘, ‘\’\”, ‘ ™’ ), $cockney );
    $static_replacements = array_merge( array( $opening_quote, $closing_quote, ‘ ?’ ), $cockneyreplace );

    Oh no! I see what happened lol

    My post got modified here just like your morse code gets modified. ha ha

    For line 98 above, the double back-ticks in the first set of quotes that are part of the code are being replaced with *nothing* because it’s expecting those to be code markers (see right below the box you type in here to see what I mean).

    You know what? Just comment out the original lines 98 and 99. If you ever need a trademark symbol instead of ™, just use the code
    & copy ;
    (with no spaces) in place of ™.

    Thread Starter abzu2

    (@abzu2)

    Mizagorn

    Thanks for all your help. Some progress has been made following your suggestion to comment out all of lines 98,99 and 176. The 3 consecutive dots are now displayed correctly, however, the 3 consecutive dashes are displayed incorrectly as a long and short dash. Previously the 3 consecutive dashes had been displayed as one long dash. If you look at the header of my site you will see what I am referring to.
    Now .-.. –- …- . Convergence of Parallel Worlds

    Hope someone makes a plugin to facilitate these “auto correct” options. WP shouldn’t rely on AI and give us mortals a try ??

    Try this:

    Comment all lines 98-99, 176-182 and 268-270.

    Or, like I said, you can turn it ALL off by changing line 33 to false.

    I agree, a plugin for this would be great!

    Thread Starter abzu2

    (@abzu2)

    Fantastic. That did the job. Thank you very much for your time and expertise. Very much appreciated.

    You’re very welcome, best wishes on your site. ??

    Thank you for marking this as resolved.

    I don’t know if anyone will see this, but I have been using WordPress on my own site for several years, and only now has it started to do autocorrect on my posts, in a little blue box which appears below the text. It must have been part of a recent update.

    I hate it! It seems to get things wrong more often than right, and I don’t always notice that what is there is not what I typed. I find in word processors as well as WordPress auto correct is a most annoying, inaccurate and persistent problem.

    I wish it was an option in the Dashboard, but it appears not to be. Grrrr! ??

    I will try this hack. Thanks.

    Hi Mizagorn,

    I hope toy read this. I changed true to false in line 33, but it made no difference to my problem. Are we talking about the same thing? I want to stop the autocorrect which shows in a small blue box below the text, and more often gets it wrong than right.

    Thanks.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If you need help, create a thread in the Troubleshooting forum: https://www.ads-software.com/support/forum/how-to-and-troubleshooting#postform

    If you want to give feedback to WordPress core, create a thread in the Requests and Feedback forum: https://www.ads-software.com/support/forum/requests-and-feedback#postform

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Customisation of WP autocorrect function’ is closed to new replies.