Repository navigation
Alternative destination snippet
Deutsch · User guide · Destination questions
This optional snippet simplifies the content editor for editors and other users without the administrator role. It removes only the Alternative post destinations input box for selected post types. Existing destinations and redirects continue to work; saving content normally without the box retains its saved destination. This is a display adjustment, not an authorization restriction.
- Create a new PHP snippet, for example “SE: Destinations for admins only”.
- Configure it to run automatically in the admin area, rather than inside a later hook. The snippet registers its own hook.
- Paste the following code. Many PHP snippet managers do not require the opening
<?phpline or add it automatically, so the example omits it. If your tool requires it, add<?phpas the first line; follow its documentation. - Adjust
$post_types, save and activate the snippet.
add_action( 'add_meta_boxes', function ( $post_type, $post ) {
if ( ! $post instanceof WP_Post ) {
return;
}
$user = wp_get_current_user();
if (
in_array( 'administrator', (array) $user->roles, true )
|| ( is_multisite() && is_super_admin() )
) {
return;
}
$post_types = array(
'post',
'page',
// 'product',
// 'projekt',
);
if ( ! in_array( $post_type, $post_types, true ) ) {
return;
}
remove_meta_box(
'se-alternative-target',
$post_type,
'normal'
);
}, 100, 2 );post means posts and page means pages; both are selected in the example. For WooCommerce products, remove // before 'product'. 'projekt' is only an example: replace it with the actual technical name of your custom post type. Types not listed are unaffected.
Administrators retain the box, as do Super Admins on multisite. The check explicitly uses the administrator role rather than a general management capability. It targets the native SE meta box in both the Classic Editor and the block editor. It does not hide the settings page or other displays.
Open affected content as an editor: the box should be absent. Save normally, then check an existing redirect while logged out. The box should remain visible to an administrator. To undo the adjustment, deactivate the snippet; it deletes no data.
The snippet was successfully used on a client site with Site Essentials 1.1.1 and confirmed by the user.
Site Essentials · Documentation / Dokumentation
Website EN · Website DE · Wiki EN · Wiki DE · Repository · Downloads & Releases
Help & bugs / Hilfe & Fehler · Discussions / Austausch · Security / Sicherheit
© 2026 David Decker – DECKERWEB.
Plugin: GPL v2 or later / GPL v2 oder höher.
- Home
- Getting started
- User guide
- All features at a glance
- Administration conveniences
- Default avatar snippets
- Destination editor snippet
- Dashboard overview and information
- General settings explained
- Site Health
- Translation updates
- Read-only abilities
- Diagnostics and shortcuts
- Maintenance mode
- Website checks
- Replace Falcon and Unbloater
- Deliberate choices
- FAQ by topic
- Changelog
- Help and security
- Startseite
- Erste Schritte
- Anleitung
- Alle Funktionen im Überblick
- Verwaltungshilfen
- Standard-Avatar per Code
- Beitragsziel-Editor per Snippet
- Dashboard-Überblick und Informationen
- Allgemeine Einstellungen erklärt
- Website-Zustand
- Übersetzungsupdates
- Rein lesende Abilities
- Diagnose und Einstiege
- Wartungsmodus
- Website-Prüfungen
- Falcon und Unbloater ersetzen
- Bewusste Entscheidungen
- Fragen nach Themen
- Änderungsverlauf
- Hilfe und Sicherheit