Code is self-replicating on my pages in Code-Editor mode

  • Unknown's avatar

    Hi, I always use the Code Editor (as the Visual Editor doesn’t work for me). It’s never been a problem and has allowed me the control I need regarding layout, etc. Just recently however, every time I’m editing a page, pieces of code will suddenly and for no reason start self-replicating, non-stop, creating useless empty code hundreds of lines long, and I can’t figure out how to stop it. It’s made editing on certain pages nearly impossible. It’s been especially a problem on this page: . (I have links there to other pages on my site, and the code for the links will start duplicating itself nonstop on the page every time I open the code editor. However, the code never contains the link text, just the code, over and over, nonstop. This only started happening a week or two ago. In the five years I’ve run this site, this has never before been a problem. On other pages it’s not quite so bad. But, if I start to write a bit of code, and then switch to another window (to copy some text, for instance), the unfinished tag will ‘finish’ itself incorrectly and then start self-replicating. What is happening? Please help!
    Thank you,
    Jeff Sirkin

    P.S. The old code-editor worked much better.

  • Unknown's avatar

    What is the URL of your site?

  • Unknown's avatar

    That’s strange, I included the URL in my original post, but it was removed from the post. Anyhow the site URL is:
    http://www.ADozenNothing.com

    The specific page where I’m having the most trouble is:

    A DOZEN QUESTIONS

  • Hello there,

    Are you able to provide a screenshot of the HTML that’s being added, and then duplicates please?

    In the past, we’ve seen things like this injected by browser extensions (Ad blockers for example.

    First, please make sure that your browser is up to date: https://browsehappy.com/

    If it is not, please try updating your browser or switching to a different browser.

    If it is, please do these two things:

    1. Try clearing your browser’s cache and cookies.

    Solve Common Browser Issues

    2. Try with all browser extensions or add-ons temporarily disabled.

    Please let us know how each step goes for you, and which browser (and version of) you’re using if you’re still having trouble.

  • Unknown's avatar

    Hi,
    I usually use Google Chrome (which is up to date, according to the <browsehappy.com> site). However, I’ve tried both Safari and Firefox, and the same thing happens. I did take a couple of screen shots, just to show you that it’s not just one bit of code. Rather, it appears to be every tag on the page that is linked back to other pages on the site.

    I don’t see a way to attach or insert a photo here. Is there a way for me to send them to you?

    Thanks again for your help!

  • Unknown's avatar

    Yes! You can use a service like Snipboard.io to upload the screenshot and then share the image link from that service here.

    Thanks!

  • Unknown's avatar

    Here are two screenshots. In the first you’ll see one line of code that is replicating nonstop.

    In the second the replicating code is at the bottom of the screenshot. It’s just these tags. Not the actual line of code that includes the link that goes within the tags, but just the tags. I don’t get it. It’s not happening on any other page on my site.

  • Hi there,

    I can see your screenshots, but they are cropped pretty tightly, so it’s hard for me to see what is going on. Can you include screenshots of the entire editing interface, so we can get a better look at what is going on?

    Also, to clarify, you have removed the code (shown in the screenshots) from your site? I did not see this when I visited https://adozennothing.com/a-dozen-questions/

    Would it be possible to set up a second page on your site (saved as a draft) that has this code issue so we can take a closer look? We would be able to see it directly that way without making the page public.

    Thanks for the additional info!

  • Unknown's avatar

    Strange that you don’t see the code when you visit the page. Though, I’ve been careful never to save the page when this starts happening. I imagine it could be an issue with my computer, or a virus, etc. However, it only happens with this one page. I will take a screenshot in a few minutes for you.

    Thanks for your help.

  • Unknown's avatar

    Screenshot with the self-replicating page code:

    I’ll make a copy of the page and save it as a draft. Once I do that, should I give you the URL here?

  • Yes, would you please give us a link to the test page showing the problem?

  • Unknown's avatar
  • Hm, I’m not seeing that page on your site.

    What’s the page’s title?

  • Unknown's avatar

    It is in the “Drafts” section of my pages, and it is called “Test Page.Test”.

  • Okay, I found it. And you’re right, that is VERY strange. Have you been able to pin down when this happens?

    Also, if you’re using just HTML, do you see the same issue when inserting it using the HTML block instead of the classic block?

  • Unknown's avatar

    Hi,

    This happens every time I open this particular page in the code editor. (I never use the visual editor because it messes up my code and spacing.)

    So, yes, I’m using just HTML. Unfortunately, I have been unable to decipher what the block editor is, or what it does differently from the classic editor. Really, it makes no sense to me. So, no, I haven’t tried the Block Editor.

    Just recently I’ve noticed (on any page I’m working on) that if I start writing a tag, then switch to another window (to copy text or something), when I come back the Code Editor will have completed (incorrectly) or altered the tag I was writing. So I was wondering if the problem on this particularly problematic page is that I’m using unconventional syntax regarding my tags (placing them around the <p> … </p> tags, rather than within the <p> … </p> tags), and that the Code Editor is reading them as incorrect and caught in some glitchy attempt to fix it?

  • Hello there,

    Interesting…

    Just recently I’ve noticed (on any page I’m working on) that if I start writing a tag, then switch to another window (to copy text or something), when I come back the Code Editor will have completed (incorrectly) or altered the tag I was writing. So I was wondering if the problem on this particularly problematic page is that I’m using unconventional syntax regarding my tags (placing them around the <p> … </p> tags, rather than within the <p> … </p> tags), and that the Code Editor is reading them as incorrect and caught in some glitchy attempt to fix it?

    I was able to replicate, perhaps a variation of what you were experience.

    I started writing a paragraph tag, switched tabs, and the editor removed these tags, which is most curious.

    I’ll be honest, doing that isn’t really standard usage of the block editor, and so it’s not something we’ve seen before.

    To help steer this properly – are you able to offer more detail as to why you’re doing what you’re doing please?

    Many thanks in advance.

  • Unknown's avatar

    An update, following my last message (above). As an experiment, I moved all the tags (see message above), placing them all within the <p> … </p> tags. After doing that, the code stopped self-replicating. I’ve checked several times now (on both the Test page and the real page), and the code is stable. My assumption about the code editor not liking the syntax on the previous version of the page seems to have been correct, I guess. Please feel free to check out the test page again and verify that it’s better. Thanks for your help!

  • Unknown's avatar

    (Sorry, the message box erased the code I was trying to use to explain what’s going on in my message above.) I’ll try again: As an experiment, I moved all the (a href)… (/a) link tags, placing them all within the <p> … </p> tags, instead of outside. After doing that, the code stopped self-replicating.

  • Unknown's avatar

    Hi, Just in case you haven’t seen my last two messages: I think I’ve eliminated the self-replicating code by rearranging the hierarchy of tags I was using. (Placing the -a href tags- within the <p> tags instead of outside them.)

    As to your question about “why I’m doing what I’m doing”–I assume you mean why I’m using the code editor rather than the visual editor?:

    When I first started using WordPress to build my online poetry journal, six years ago, the visual editor wouldn’t allow me the precise control I needed to lay out poems. The visual editor didn’t give me good control of spacing, and it didn’t allow me to insert blank spaces or blank lines, etc. So, I taught myself css and started using css on the page in order to gain the precise control I needed with text. Also, the visual editor not only didn’t allow me the control I needed, but, if I would switch to the Visual Editor, it would in fact ERASE code that I had written. Usually it would erase non-breaking spaces, which would mess up an entire page I had worked on for hours sometimes, and then I’d have to re-insert it all. It was maddening. As a result, I started to use the classic HTML editor. Not ideal on my eyes, but it worked, and it gave me the control I needed over everything.

    When WordPress rolled out the new Block Editor as an option, I avoided it, as I was afraid it would mess up my pages, like the Visual Editor had in the past. Once WordPress forced me to the new editing interface (sometime this past year?), I just found the Code Editor again so I could continue the practice (writing all the code myself) I’d been using for 5 years already. (And, to support my decision: when I switched to the Block Editor on the Test Page today, as you’d suggested, it erased all the non-breaking spaces on the page and it erased all the links on the page. I CANNOT use an interface that erases code, nor one that takes away my ability to lay out my pages as I need to. It just doesn’t make sense to me.

    Anyhow, I don’t know how the Blocks thing works, nor how I’m supposed to use it, and it appears more destructive to me than useful. Perhaps there was a tutorial available at some point, but since I already had a system going, and I don’t really have much free time, I never learned it.

    Sorry for the long story…

  • The topic ‘Code is self-replicating on my pages in Code-Editor mode’ is closed to new replies.