Home Forums Add-ons Flexible Content Field Disable add/delete/move Flexible Content for non-admins


Disable add/delete/move Flexible Content for non-admins

  • Hi there,

    Is there any way to disable the add/delete/move options for non-admins? I’d like my clients to simply edit the content, but no more than that.

    I think I could remove some of the features with CSS, but if there is a more natural approach i’d like that instead.

    I use Advanced Custom Fields: Extended as well if that makes a difference.


  • There are 2 ways you can do this.

    1) Add an ‘admin_head’, action that outputs CSS to hide controls if the user is not an admin.

    2) The second way is with JavaScript, you can remove the controls completely something like this is a basic example, I’m sure I’m missing something but it might get you started

      if (typof acf === 'undefined') {
      acf.add_action('ready append') {
        // target all flex fields
        // you can adjust this selector to target specific flex fields
        // but adding [data-key="field_XXXXX"] before the selector
        $('.acf-flexible-content a').each(function(index, element) {
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.