Remove Junk Code

Ok, so my website has a bit of “junk” code that shows right on top of the logo bar (?>)

I have tried “inspecting” the code to try and remove it:
But when I click on the specific line, I don’t really see a “class name” that I can use to remove using custom CSS"

I have been trying to do this for months on my own. Now I humbly ask for the community’s help.

Much obliged!

Here is a better view of the “junk code” in question:

What you are seeing is most likely a broken plugin.

Try disabling all plugins and activating them one by one and checking your website in between to see which plugin is faulty.

Good luck!

1 Like

Thanks friend. but still no luck…

I tried every plug in…

This is so irritating…

What is your website URL?

1 Like

I noticed you’re using a child theme. Is it possible that you have an extra “?>” somewhere in one of the files overriding the parent X theme?

1 Like

Thanks for the reply!
The URL is: thestatetoday.com

And yes, I am using X with a child theme. The problem is I don’t know where to look X(

You would need FTP access to your files.

Then search through the files in the x-child > views folder. I’m pretty certain it’s somewhere there.

1 Like

Thanks man, I really appreciate you taking the time.

Now this is probably going to sound pretty ignorant, but all I see when I go on the editor under the child theme is this:

Don’t worry about it. It’s not ignorance, I just get the feeling that you’re not familiar with FTP access.

You won’t see the folder or files I’m referring to in the WordPress editor. You might want to ask your hosting provider for instructions to access your WordPress theme files via FTP or cPanel file editor.

1 Like

That is a PHP closing tag. You won’t be able to inspect what is causing it from the front end. As others have said, you need to access it via FTP. The WP editor isn’t the best for this. Most hosts offer a file explorer in their control panels. You might what to check your child functions.php for any custom code that may be missing a proper opening tag. The tag in question is just below the body tag in the header tag.

1 Like

you might want to check your functions.php file (/wp-content/themes/x-child/funtions.php). as @kevinb said, that’s a PHP closing tag and that used to happen to me a lot back in the days i was learning how to create functions in WP. i don’t know if you have copy-pasted code from the net or even wrote it yourself but in my case it’s always the first place to look when something like this happens.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.