2

I want to remove the bold option from the toolbar in the wordpress paragraph block. I did not find any documentation on that. The closiest thing I found was a tutorial to add buttons.

remove bold button from toolbar

Any help would be appreciated.

4
  • Can I ask why you need this? What is the problem you're trying to solve? I ask because there's a very high chance that your problem can be solved via other means, but because you specifically asked about the bold button in the paragraph toolbar, and provided no context for why, I can't help :(
    – Tom J Nowell
    Apr 14, 2020 at 10:24
  • Yes. The graphic designer wants no bold at all.
    – Marc
    Apr 14, 2020 at 10:34
  • So it's an aesthetic preference? I ask because if this were to fix a problem, e.g. no bold in image descriptions, etc then alternative solutions might be possible.
    – Tom J Nowell
    Apr 14, 2020 at 11:04
  • Yes, it is an aesthetic preference.
    – Marc
    Apr 15, 2020 at 10:28

1 Answer 1

1

I want to remove the bold option from the toolbar in the wordpress paragraph block.

At the moment, it cannot be done, the paragraph block doesn't use the format API but instead hardcodes the markup for those buttons in the toolbar component

You could:

  • strip out the bold tags on save in PHP
  • hide the button using CSS
  • Add a CSS editor style so that the font weight of bold text is the same as unbolded text
  • Open a feature request on the GitHub repo for Gutenberg

But:

  • These won't prevent the bold shortcut of cmd+b
  • Users can still use markdown shortcuts by writing *bold text*
  • Users can also write the bold text somewhere else, then copy paste it into the paragraph block
3
  • Thanks for reminding. I have deleted the post because it is of no value to people. Apr 14, 2020 at 10:38
  • Is it good to compile a custom version from the source of block editor and load by admin script filter if in need? Apr 14, 2020 at 10:50
  • I would advise against it as you'd need to redo the change on every update. Additionally, it would require lots of other changes, e.g. stripping out bold text on paste, removing shortcuts, etc
    – Tom J Nowell
    Apr 14, 2020 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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