Backslash wrongly inserted before the apostrophe character

#889199
  • Resolved Phil Chavanne
    Rank Math free

    Set-up wizard: RankMath inserts a backslash before the apostrophe (‘) and duplicates the backslash.
    e.g. “Rock\\’n\\’Roll Fantasy Camp”

    Website Name Rock\’n\’Roll Fantasy Camp
    <meta property=”og:site_name” content=”Rock\'n\'Roll Fantasy Camp” />

    Freakin’ aggravating. What’s the fix?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello,

    We apologize for the issue you are facing with the backslash being inserted before the apostrophe in the setup wizard. This can indeed be frustrating.

    To resolve this issue, you can try the following steps:

    1. Check for Conflicts: Ensure that there are no other plugins that might be interfering with how Rank Math handles special characters. Temporarily deactivate other plugins to see if the issue persists.
    2. Update Rank Math: Make sure you are using the latest version of Rank Math. Updates often include bug fixes that could resolve this issue.
    3. Re-enter the Website Name: Go to the Rank Math settings and re-enter your website name without any backslashes. Sometimes, simply re-saving the settings can correct formatting issues.
    4. Database Cleanup: If the issue continues, consider checking your database for any unwanted characters or entries that may have been saved incorrectly. You might need to manually edit these entries in your database.

    If these steps do not resolve the issue, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further. Thank you for bringing this concern to our attention!

    Hello,

    Thank you for contacting us. We apologize for any inconvenience this issue may have caused.

    The apostrophe that you are using and it’s getting converted because that is being caught as a single quote which is escaped by our plugin as recommended by WordPress when handling HTML attributes: https://developer.wordpress.org/reference/functions/esc_attr/

    We do escape all HTML attributes to prevent issues in the code, not only the metadata but also others.

    This won’t cause any issues with search engines as those attributes that contain escaped characters can be read correctly and the correct data will be converted to the UTF-8 character set.

    Unfortunately, we cannot change this behavior in the plugin because of the reasons mentioned above.

    The only way a character would not be escaped is if you use one that doesn’t get parsed by the function we mentioned above.

    One way around this is by copying the HTML character of the appropriate value you want and copy-paste in that place. Here’s the one for the apostrophe instead of single quote encoding: https://www.toptal.com/designers/htmlarrows/punctuation/apostrophe/

    Don’t hesitate to get in touch if you have any other questions.

    Hi, thank you for your reply.

    I tried to manually add this HTML code in this way:
    Rock 'n' Roll Fantasy Camp

    then clicked on “save and continue”

    And went back to “Your Site”: the expression is correctly spelled: Rock ‘n’ Roll Fantasy Camp

    However, if I then save again the expression is transformed to: Rock \’n\’ Roll Fantasy Camp

    So the plugin converts the HTML code into something else and reinterprets it wrongly.

    In other words, I can’t make any change in any of the later steps (and Save & Continue) or the plugin will screw up the code .

    Any fix?

    Hello,

    In this case, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hi Ike,

    Thank you for coming back to me.

    I hesitate to touch anything right now because I’m in the middle of resubmitting to the GSC, and the spelling is correct (I saved the fields once, and did not re-save — the issue which triggers the code rewriting).

    phil

    Hello,

    That’s alright. You can update us with your progress.

    Please do not hesitate to let us know if you need our assistance with anything else.

    Thanks.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The ticket ‘Backslash wrongly inserted before the apostrophe character’ is closed to new replies.