Remove Unwanted <p> | Community
Skip to main content
May 27, 2015
Solved

Remove Unwanted <p>

  • May 27, 2015
  • 4 replies
  • 4784 views

Is there away to stop the Email editor from adding <p> around everything? I could CSS to turn it off but is there another way?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Edward_Unthank_

Wrap them in empty div tags! When you're in the WYSIWYG, you can edit the HTML, and there when Marketo would normally throw in paragraph tags, you can instead wrap the content in <div> tags. Marketo considers these acceptable and therefore won't swap them out with <p> tags, and in emails your <div> tags (probably) don't have any actual styling to them, so it doesn't affect formatting in email clients.

The WYSIWYG replicates the HTML wrapping of the line you're currently on when you go to a new line. So if you edit the WYSIWYG HTML to be <div>Placeholder paragraph here.</div> and then swap to the non-HTML editor, you'll be editing the text wrapped in that div. When you hit Enter at the end of that line, it'll create a new line wrapped in the same HTML—you'll be creating more <div></div> lines.

You should be careful about using this if either you or your team doesn't understand HTML. Changing the way the WYSIWYG functions like this will quickly change the acronym's meaning from "What you see is what you get" to "What you see ISN'T what you get."

Cheers,
Edward Unthank | Founder, Etumos

4 replies

Joe_Reitz
New Participant
December 14, 2015

This is aggravating... But I'd like to echo what Edward Unthank​ said. The empty DIV tags work a treat.

As an aside, I can't imagine any user that leverages custom templates would ever appreciate superflous lines of HTML added to their emails... Most of my team doesn't understand HTML, so this move puts them out of their depth by default. Again... Aggravating.

If it doesn't look cool, you're probably doing it wrong.
Justin_Cooperm2
New Participant
December 14, 2015

This isn't true anymore...this thread is very old.

You now have complete control of what the "root block element" is for the text editor in your subscription. Please see this thread: Rich text editor adding paragraph tags

If you don't want <p> to be added when you're editing text, you can change it in Admin. That said, we don't recommend you change it. For the most part, all text editors will add block elements around text so that rich formatting options can be offered. If you don't have a block element, some formatting isn't possible.

Joe_Reitz
New Participant
December 14, 2015

Well... I just started getting random <p> tags, so...

Helpful link, though. I'll give those ideas a try.

If it doesn't look cool, you're probably doing it wrong.
Edward_Unthank_
Edward_Unthank_Accepted solution
New Participant
May 27, 2015

Wrap them in empty div tags! When you're in the WYSIWYG, you can edit the HTML, and there when Marketo would normally throw in paragraph tags, you can instead wrap the content in <div> tags. Marketo considers these acceptable and therefore won't swap them out with <p> tags, and in emails your <div> tags (probably) don't have any actual styling to them, so it doesn't affect formatting in email clients.

The WYSIWYG replicates the HTML wrapping of the line you're currently on when you go to a new line. So if you edit the WYSIWYG HTML to be <div>Placeholder paragraph here.</div> and then swap to the non-HTML editor, you'll be editing the text wrapped in that div. When you hit Enter at the end of that line, it'll create a new line wrapped in the same HTML—you'll be creating more <div></div> lines.

You should be careful about using this if either you or your team doesn't understand HTML. Changing the way the WYSIWYG functions like this will quickly change the acronym's meaning from "What you see is what you get" to "What you see ISN'T what you get."

Cheers,
Edward Unthank | Founder, Etumos

May 27, 2015

I keep finding that Marketo no matter what I do wraps text in a <p>. I will give the <div> a try. Thanks

Justin_Norris1
New Participant
May 27, 2015

Michael Ramos​ my experience has been that if you use the WYSIWYG, tags will be inserted. If you edit the HTML only you can control it.

May 27, 2015

Michael Ramos​ FYI. Moved to Products and Support

FYI. Nice robo avatar