Skip Navigation

[Resolved] Extra p tags – not on archive

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user is building using Beaver Builder. She gets some extra

tags.

Solution:
This is a known issue and will be fixed in the future.
As a workaround, use a custom Javascript code that will remove all empty

tags.


jQuery(function($){
  // remove empty <p> tags.
  $('p').each(function(){
    var $this = jQuery(this)
    if ( $this.is(":empty") ) 
      $this.remove()
  })
});

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 14 replies, has 4 voices.

Last updated by matsF 4 years ago.

Assisted by: Jamal.

Author
Posts
#1840641
screencapture-luxe-wordifysites-featured-trip-savoring-france-paris-lyon-and-provence-with-master-sommelier-doug-frost-2020-11-10-19_49_54-edit.png

I've read all the tickets about p tags in archives, but I'm getting them on single post content templates. I'm also seeing br tags added on the content template to buttons that aren't using Toolset.

I'm building this Content Template with Beaver Builder.

The p tags are added to images.
The br tags are added to buttons that have nothing to do with Toolset. These br tags only appear on the Content Template and not on any other pages.

#1841127

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

We have an existing report about this same thing, only a prerequisite for the problem is that you include a Types WYSIWYG field somewhere in the template.

Can you confirm if that is the case with your template?

#1841343

Hi Nigel - Yes, there are some WYSIWIG fields on the template.

Do I need to change those to a different type of field? I'd prefer not to, if possible, because my non-techy client is using a Toolset Form to add his content to these fields and he really does need a WYSIWIG to get the formatting right.

Is there a workaround?

thanks!

#1841819

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Unfortunately I don't have a workaround.

From the internal tickets I can see that the developers took a look at this some time ago, concluded there was no easy fix and put it to one side.

I've updated the tickets to add this thread to remind them it is an active issue, but I can't say when it will be worked on again, and I'm sorry to say I don't have a solution for you.

#1842097

Hello Chris,

I am marking this ticket as escalated, so I can let you know when we have any news from the development team.

We are really sorry for not being able, currently, to provide a solution or a workaround.

#1842099

We may also find a way to remove those extra p tags with custom Javascript. Let us know if you need help with that.

#1842109

Hi Jamal - thank you for the offer. Will the custom JS fix BOTH the br and p tags?

If so, then yes I would love help with that.

If not, then I will need to remove the WYSIWIG fields.

thanks!

#1842137

Yes, with JS we can remove both
and <p> tags, but the solution won't be a final fix, it will rather be different hacks for each of the content templates that present this issue.
For that, I'll need to know what content templates present this issue and to have admin access in order to check if the custom JS code works. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1842303

I followed the first section in this article to add the following Javascript code to the content template hidden link

jQuery(function($){
  // remove empty <p> tags.
  $('p').each(function(){
    var $this = jQuery(this)
    if ( $this.is(":empty") ) 
      $this.remove()
  })
  // remove <br> tags from the calls to action buttons
  $('a.fl-button br').remove();
});

It seems to give the expected results. Please check and let us know if it is a viable workaround for you.

We'll keep you informed as soon as we have news from the development team.

#1842393

Hey Jamal - Thank you! We are 99% there.

There is a remaining p tag under the photos. There were two p tags to begin with.

#1843489

I am sorry, but I could not find these p tags under the photos. Can you take a screenshot?

#1843495

Here you go: hidden link

thanks for your help!

#1843515

It is not, actually, an empty <p> tag. It has the image tag inside of it. And it has a margin-bottom applied. Check this screenshot hidden link

I hope this helps. Let me know if you have any questions.

#1846327

My issue is resolved now. Thank you!

#1962681

Hi,

I've found the same problem when updating a clients' site not being updated for a year. When I worked on it a year ago everything was fine. So the issue must have occured last year between April and November, as it seems.

I'm very much interested in being informed about the progress in this matter. A little strange it's so hard to solve since it once was working. I will put the js snippets in the content templates until further notice. But I expect a real solution

And why isn't it put under the "Known issues" section?

Regards
Mats