• Resolved Justin Allen

    (@justinallen)


    On certain posts that have non-alphanumeric characters in the post title, we are having random strings that look like debugging statements injected into the page metadata – title tag – that then shows up in Google Analytics.

    The strings look like <!–string(1) “0” –><!–string(1) “1” –> and show up with no rhyme or reason on certain articles. But the number of these strings always matches the number of non-alphanumeric characters in the headline (comma, apostrophe, etc.).

    Spent many hours trying to debug this and fish through the plugin code. Please feel free to contact me directly if there’s anything I can do on my end to help identify the problem.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Yes, I can see:

    <title><!--string(1) "0"
    -->Some teachers unions, districts at odds over live distance learning instruction – EdSource</title>

    It appears you may have a var_dump() somewhere in your site that is causing this to happen.

    I suggest looking through the codebase of your theme/plugins to find instances of var_dump.

    Thread Starter Justin Allen

    (@justinallen)

    Thanks for your help. Could it be coming from anywhere in our theme (say, functions.php)? I have a custom AMP theme made by using overrides in an /amp subdirectory of our theme folder. I checked there and removed all var_dump() statements but still seeing the issue.

    Plugin Author Weston Ruter

    (@westonruter)

    Yes, it could be coming from your theme.

    The it’s no longer appearing in the title tag on https://edsource.org/2020/some-teachers-unions-districts-at-odds-over-live-distance-learning-instruction/635237/amp

    So perhaps you were just looking at a cached page.

    Thread Starter Justin Allen

    (@justinallen)

    Thanks Weston, you pointed me in the right direction and I was able to find the var_dump() statements in some legacy code in our theme.

    My mistake was just looking in the AMP template files, but I realized that some core theme files like functions.php (in our case, a file loaded by that file) also get loaded and looked in there until I found the problem.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Title tag has random strings injected on certain posts’ is closed to new replies.