Skip Navigation

[Resolved] Remove H1 from Wysiwig custom post

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by quentinN 1 year, 10 months ago.

Assisted by: Nigel.

Author
Posts
#2531721

Hello,
I follow up on my previous ticket which had however been solved.. (https://toolset.com/forums/topic/disable-h1-h4-h5-in-custom-field-wysiwyg/)

On my latest sites, even with version 3.4.17 of Types and the code (function.php) :

// DELETE THE POSSIBILITY OF ENTERING H1, H4, H5..
function remove_h1_from_heading($args) {
// Just omit h1 from the list
$args['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3; Heading 4=h4;';
return $args;
}
add_filter('tiny_mce_before_init', 'remove_h1_from_heading');

I still have the H1, H5, H6 to offer in the custom fields (but it works well in the basic wordpress editor)

Can you help me ?
Thanks, Quentin

#2531867

Nigel
Supporter

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

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

Screenshot 2023-01-11 at 11.37.14.png

Hi there

I tested your code on my local test site and it works as expected (screenshot).

I'm not sure what to suggest on your site other than to clear your browser caches (or try in a different browser that you wouldn't ordinarily use).

#2531885

Sorry but I have try from Safari and it doesn't work.

[redacted]

Can you check this page : hidden link
You will see at bottom of the page a section called "Section de texte 1" with "Section texte colonne gauche" and "Section texte colonne droite". The Wysiwig show H1, H5, H6..

#2531929

Nigel
Supporter

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

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

I've edited your reply to remove the sensitive data, please only share site credentials when we set a private reply for you.

I see that you are referring to wysiwyg fields that are inside the repeatable fields group UI rather than fields that appear directly in the post editor (it works correctly for the "Résumé de la page" field).

I'm sorry but I don't have any code to offer you where this modification will work inside the UI for repeatable field groups, the process of initializing the WYSIWYG fields within that context is evidently different.

I've escalated this to see if the developers are able to offer any alternatives (or to evaluate if we need to make any changes for this to work).

I will update you if I get any feedback.

#2531947

Hello Nigel,

Thank you for your feedback and investigation.

I understand.
Indeed, I would like to make this possible in the future.
If you can pass this task to the developers for a future update it would be great because in my opinion, it is essential that users (customers) can not choose any tag that would harm the SEO of the site.

Thanks a lot!

Quentin