Wordpress editor rearranges my html

3 replies
  • WEB DESIGN
  • |
This has to be a common problem yet I can't find the answer via search.

When I use the google analytics javascript to add an onclick (tracks click) in my href, the editor in wordpress rearranges it and then it no longer tracks clicks in analytics and counts it as a bounce still.

Here is my example:

Original html:
<a rel="nofollow" href="amazonafflink" onclick="_gaq.push..etc" />

When I switch from Visual Mode to HTML mode and back in wordpress editor, it rearranges it to something like:

<a onclick="_gaq.push...etc" href="amazonlink" rel="nofollow">

Now I still get credit for my amazon clicks, but analytics does not like it and can't process it.
#editor #html #rearranges #wordpress
  • Profile picture of the author Istvan Horvath
    If you deal with code in your posts.. .I suggest you completely turn OFF the visual/wysiwyg editor in your profile.
    Signature

    {{ DiscussionBoard.errors[7063885].message }}
  • Profile picture of the author Danny Woolard
    How do you turn it off?
    {{ DiscussionBoard.errors[7063915].message }}
  • Profile picture of the author Istvan Horvath
    Users > My profile (your profile?)
    Signature

    {{ DiscussionBoard.errors[7063976].message }}

Trending Topics