Support

Account

Home Forums General Issues Remove Alt & Description fields from ACF Gallery Admin

Solving

Remove Alt & Description fields from ACF Gallery Admin

  • I am looking to remove the alt & description fields on images, from the admin screen for the ACF Gallery field.

    However, I cannot target these with CSS as there are no selectors present.

    Please kindly help.

    thanks
    Andrew

  • The fields you’re trying to remove are standard WP fields associated with images. ACF duplicates these fields for the gallery image but does not offer any way to remove them.

  • ok but the HTML code is wrapped in ACF. I still can’t figure this out 🙁

    <tr class="acf-field acf-field-text" data-name="alt" data-type="text">
    		<td class="acf-label"><label for="attachments-6462-alt">Alt Text</label></td>
    		<td class="acf-input">
    		<div class="acf-input-wrap"><input type="text" id="attachments-6462-alt" name="attachments[6462][alt]"></div>					</td>
    </tr>
  • Yes, those are ACF fields. In this case ACF is duplicating what you would see on the standard WP attachment popup. When submitted ACF populates the information into the standard WP fields that are used to store this information.

    The only way to “remove” these fields would be to add custom CSS to your WP admin to hide them. I’m not exactly sure of the CSS that would be needed to do this. If I have a few minutes today I will look into it.

  • ok figured this out by using css:

    .acf-field-text[data-name="title"], .acf-field-text[data-name="alt"] {display:none;}

  • I didn’t know I could target [data-name] using CSS..

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Remove Alt & Description fields from ACF Gallery Admin’ is closed to new replies.