
Veröffentlicht am: 15.11.2020 | Letztes Update am: 16.03.21 | Lesezeit: 2 Minute/n
Mit diesen Codes können Sie Ihre WordPress-Webseite anpassen und ändern. Die Codes müssen in der functions.php im Theme-Ordner eingefügt werden.
WordPress Version entfernen
Entfernen der WordPress-Version im Header
function hnp_remove_version_info() {
return '';
}
add_filter( 'the_generator', 'hnp_remove_version_info' );WordPress Emoji entfernen
WordPress Emoji dauerhaft entfernen
function hnp_wp_emojicons() {
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
add_filter( 'tiny_mce_plugins', 'hnp_emojicons_tinymce' );
add_filter( 'emoji_svg_url', '__return_false' );
}
add_action( 'init', 'hnp_wp_emojicons' );
function hnp_emojicons_tinymce( $plugins ) {
if ( is_array( $plugins ) ) {
return array_diff( $plugins, array( 'wpemoji' ) );
} else {
return array();
}
}Beiträge entfernen
Beiträge Funktion deaktivieren
add_action( 'init', 'hnp_remove_default_post_type', 1 );
function hnp_remove_default_post_type() {
register_post_type( 'post', array(
'capability_type' => 'post',
'capabilities' => array(
'edit_post' => 'do_not_allow', // false < WP 4.5
'publish_posts' => 'do_not_allow', // false < WP 4.5
'create_posts' => 'do_not_allow', // false < WP 4.5
'edit_posts' => 'do_not_allow', // false < WP 4.5
),
'map_meta_cap' => false
) );
}Kommentar Funktion entfernen
Kommentare deaktivieren
// Admin Menu
add_action( 'admin_menu', 'hnp_remove_admin_menus' );
function hnp_remove_admin_menus() {
remove_menu_page( 'edit-comments.php' );
}
// Seiten und Beiträge
add_action( 'init', 'remove_comment_support', 100 );
function remove_comment_support() {
remove_post_type_support( 'post', 'comments' );
remove_post_type_support( 'page', 'comments' );
}
// Admin Leiste
function hnp_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu( 'comments' );
}
add_action( 'wp_before_admin_bar_render', 'hnp_admin_bar_render' );↩ Zurück zur Blogübersicht
