HTML tags are being stripped when I copy a post
I’ve noticed that when I copy a post (containing HTML tags) that some of the tags (mainly <span> and <p>) are being stripped from the new post. Why would this be happening?
The blog I need help with is stamfordstamcell.wordpress.com.
Will you please post a link to the post or page this is happening in? I suspect you are using deprecated code.
Also when you say “copy a post” are you doing that manually? Or are you using the copy a post feature?
Thanks for your reply – yep if you look at this:
you can see the headers in the second post look wrong, I am using <h1><span>header</span></h1>. I have already gone in and replaced the span tags but it has stripped it out again. I am also using the copy a post feature.
The strange thing is I am using the same tags on:
and it’s working fine?
A plain span tag pair enclosing the same text that’s enclosed in an h tag pair is meaningless. What exactly are you trying to do?
It’s an image replacement technique – I place a header graphic in the H1 tag using css and then display:none on the span. Yes I know not a perfect solution but it’s just for an internal work newsletter and I want to keep it as ‘semantic’ as possible by keeping the H1 tags.
Well, the post editor doesn’t know that!
See here for possible alternatives:
It doesn’t really matter why I want to do it, I just want to know why the span and sometimes p tags are being removed from the post, when they are not being removed on other posts – if they were being stripped from all the other posts then maybe I’d make the assumption that wordpress doesn’t like that combination of code but that’s not the case.
Thank you for posting that link though, very interesting article
The editor strips wrong code (or code it considers wrong) when you swirch to Visual.
hmm ok, even though *technically* there’s nothing wrong with it. Looks like I’ll have to use another method, thanks for your help
The topic ‘HTML tags are being stripped when I copy a post’ is closed to new replies.