Need help? Check out our Support site, then

HTML tags are being stripped when I copy a post

  1. Hi,
    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

  2. Will you please post a link to the post or page this is happening in? I suspect you are using deprecated code.

  3. Also when you say "copy a post" are you doing that manually? Or are you using the copy a post feature?

  4. 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?

  5. 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?

  6. 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.

  7. Well, the post editor doesn't know that!
    See here for possible alternatives:

  8. 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

  9. You're welcome.

    The editor strips wrong code (or code it considers wrong) when you swirch to Visual.

  10. hmm ok, even though *technically* there's nothing wrong with it. Looks like I'll have to use another method, thanks for your help

Topic Closed

This topic has been closed to new replies.

About this Topic