ACF position “After the title before the content” does not work (solution)

The WordPress plugin ACF (Advanced Custom Fields) can be used to create very complex input masks. This makes it all the more important to be able to determine where which field group is displayed. There are basically three positions available in ACF: “After the title before the content” (or “High (after title)” in the English version) causes the field group to appear between the title and the text editor – “After the content” (or “Normal (after content)” in English) causes the field group to be displayed below the text editor and if “Side” is selected, the field group is displayed in the sidebar (on the right). My favorite position is often the one where the additional input fields are positioned between the title and the text editor.

The position of field groups can also be changed manually in the Classic Editor – especially if you have selected the option “Standard (WP metabox)” when displaying a field group under “Presentation” – I usually use “Transitionless (no metabox)”.

When editing a page, it can happen that you accidentally change the position of a field group. Then it is suddenly no longer between the title and the text editor, but below the text editor. Unfortunately, you cannot simply move the field group back by hand. Almost all elements of the input mask can be moved to almost all positions – but the area between the title and the text editor is inaccessible.

With the help of a code snippet, which is placed in the functions.php, you can undo or remove the manual shift.

function prefix_reset_metabox_positions(){
  delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_post' );
  delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_page' );
  delete_user_meta( wp_get_current_user()->ID, 'meta-box-order_YOUR_CPT_SLUG' );
}
add_action( 'admin_init', 'prefix_reset_metabox_positions' );

I found the code here in the ACF support forum:

Position : High (after title) not working

But be careful: the function prefix_reset_metabox_positions ensures that the meta boxes are always moved back to the position specified by ACF. A manual reorganization of the input fields and field groups is then no longer possible. That’s fine with me – I don’t want field groups to be moved to a different position manually. But if you want to give the editors this possibility to reorganize the input mask, you should remove the code snippet from the functions.php after a successful reset.

However, if you want to force the position specified by ACF, you can safely leave the code snippet in functions.php.