WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to right align (class="alignright") a YouTube video AND allow my client to edit the surrounding text in the future using the visual editor. I simply added class="alignright" to the tag containing the embed using the HTML editor however when any changes are made to the text using the visual editor WordPress strips the extra code. I think it might be impossible to get the result that I want but could anyone confirm my suspicions or give me a workaround.

share|improve this question
up vote 1 down vote accepted

Use an id and CSS selector for the element and align it in your stylesheet.

share|improve this answer
Do you mean that WordPress will not strip an id the way it strips the class ? – byronyasgur Oct 4 '11 at 21:43
No, I mean do it from outside of the post via external style sheet, so you don't have to worry about the stripping of code. So target the object for that post id. – Drai Oct 4 '11 at 21:52
oh the POST id ! - thanks - good idea – byronyasgur Oct 4 '11 at 22:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.