How to get rid of “var rankMath” in the HTML?

#22647
  • Resolved Poor Swiss
    Rank Math free

    Hi,

    On my blog, I get a block of code like this on every page:

    <script type='text/javascript'>/* <![CDATA[ */ var rankMath = {"version":"1.0.35.3","ajaxurl":"https:\/\/XXXXXXXXXXXXXXXXXXXXX\/wp-admin\/admin-ajax.php","adminurl":"https:\/\/XXXXXXX\/wp-admin\/admin.php","security":"XXXXXXXXX"}; /* ]]> */</script>

    How can I remove that from the front-end?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math today.

    This script is used to hold variables that should be used on the page such as stop words. Kindly allow me to consult our dev team about the consequence of removing this and I will get back to you shortly.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Todd
    Rank Math free

    Hello,

    Assuming you have stop words option already disabled in WordPress Dashboard > Rank Math > General Settings > Links:
    null

    The code you are referring to only shows up when you are logged in to your website. If you check the page source in an incognito without logging in, you will see that the code doesn’t appear in the page source of the frontend.

    That code is added to make this admin menu item from Rank Math work:
    null

    If you would still want to remove it, let me know and I will give you the instructions (it involves adding some code to your theme files).

    Thank you.

    Poor Swiss
    Rank Math free

    Hi Todd,

    Yes, this option is disabled.

    Since my admin bar is disabled, I would think that this code serves no purpose.
    Could you make it so the plugin does not add the code if the admin bar is not enabled?

    Otherwise, yes, I would love to get some code to remove it.

    Thanks

    Todd
    Rank Math free

    Hello,

    We are sorry about that. It shouldn’t be added if the admin bar is disabled.

    We will fix this in an upcoming version and release the update very soon.

    We would really appreciate your patience in this matter.

    Poor Swiss
    Rank Math free

    Hi Todd,

    Thanks for coming back to me!

    This is not a breaking problem for me now. But it will be great once this is fixed in a future version!

    Thanks

    Michael Davis
    Rank Math pro

    Hello,

    We appreciate your understanding and patience in this.

    Feel free to contact us for any other questions, comments or suggestions.

    Thank you.

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

The ticket ‘How to get rid of “var rankMath” in the HTML?’ is closed to new replies.