How to make elements not editable in visual editor

I have bootstrap grid in some pages, which I've made visibale in the editor by styling in editor styles.

Is there a way to make the column div not removable in visual editor, kind of like how you can't delete a table cell with a backspace. So that when a client deletes the text in a div and keeps pressing the backspace it wont delete the div itself? However I do want the code to be editable when you switch to Text tab.

Also is there a way to make an entire div read only so that it could not be edited in the visual tab?

Topic visual-editor Wordpress

Category Web


I don't think this is doable on the default visual editor. You can try one of the plugin solutions out there. The most popular ones are:

One other approach to solve the problem is for you to create your own custom template. Then, you can have custom fields populating the content on the template: https://developer.wordpress.org/themes/basics/template-hierarchy/ You will need PHP and WordPress developer skills to accomplish that. Good luck.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.