Disable WordPress REST API

add_filter( ‘rest_authentication_errors’, function ( $access ) { return new WP_Error( ‘rest_disabled’, __( ‘The WordPress REST API has been disabled.’ ), array( ‘status’ => rest_authorization_required_code(), ) ); } );Continue reading

Disable Automatic Updates

// Disable core auto-updates add_filter( ‘auto_update_core’, ‘__return_false’ ); // Disable auto-updates for plugins. add_filter( ‘auto_update_plugin’, ‘__return_false’ ); // Disable auto-updates for themes. add_filter( ‘auto_update_theme’, ‘__return_false’ );Continue reading

Disable Automatic Updates Emails

// Disable auto-update emails. add_filter( ‘auto_core_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for plugins. add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for themes. add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ );Continue reading

Disable Attachment Pages

add_action( ‘template_redirect’, function () { global $post; if ( ! is_attachment() || ! isset( $post->post_parent ) || ! is_numeric( $post->post_parent ) ) { return; } // Does the attachment have a parent post? // If the post is trashed, fallback…Continue reading

Disable RSS Feeds

/** * Display a custom message instead of the RSS Feeds. * * @return void */ function wpcode_snippet_disable_feed() { wp_die( sprintf( // Translators: Placeholders for the homepage link. esc_html__( ‘No feed available, please visit our %1$shomepage%2$s!’ ), ‘ ‘, ‘‘…Continue reading

Change Admin Panel Footer Text

add_filter( ‘admin_footer_text’, function ( $footer_text ) { // Edit the line below to customize the footer text. $footer_text = ‘Powered by WordPress | WordPress Tutorials: WPBeginner‘; return $footer_text; } );Continue reading

Add Featured Images to RSS Feeds

/** * Add the post thumbnail, if available, before the content in feeds. * * @param string $content The post content. * * @return string */ function wpcode_snippet_rss_post_thumbnail( $content ) { global $post; if ( has_post_thumbnail( $post->ID ) ) {…Continue reading