Advanced Logout Redirect
// Advanced Logout Redirect / Kiri Vadivelu / 2026 add_action(‘wp_logout’, ‘redirect_after_logout’); function redirect_after_logout() { wp_safe_redirect(home_url()); exit; }Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
// Advanced Logout Redirect / Kiri Vadivelu / 2026 add_action(‘wp_logout’, ‘redirect_after_logout’); function redirect_after_logout() { wp_safe_redirect(home_url()); exit; }Continue reading
// Advanced Login Redirect / Kiri Vadivelu / 2026 function advanced_login_redirect( $redirect_to, $request, $user ) { if ( isset( $user->roles ) && is_array( $user->roles ) ) { // Role based user redirect if ( in_array( ‘member’, $user->roles ) ) {…Continue reading
// WP Mail SMTP 4.10.0: stop the “Class ‘Normalizer’ not found” fatal on hosts without PHP intl. // Remove once the plugin update with the fix is installed, or once intl is enabled. if ( ! extension_loaded( ‘intl’ ) &&…Continue reading
// Progressive Password Field / Kiri Vadivelu / 2026 add_action(‘login_enqueue_scripts’, ‘field_without_script’); function field_without_script() { echo ‘ ‘; }Continue reading
// Disable User Login / Kiri Vadivelu / 2026 function disable_user_login( $user ) { if ( is_wp_error( $user ) ) { return $user; } if ( is_a( $user, ‘WP_User’ ) ) { $disabled_user_ids = array( 10 ); // User IDs…Continue reading
// Restrict WP Heartbeat / Kiri Vadivelu / 2026 add_action( ‘init’, function() { if ( ! is_admin() ) { wp_deregister_script( ‘heartbeat’ ); // Disable heartbeat in frontend } }); add_filter( ‘heartbeat_settings’, function( $settings ) { $settings[‘interval’] = 60; // Set…Continue reading
/** * DVA – Yoast handmatige canonicals veilig opschonen V2 * * Bevat: * – WordPress-pagina’s (page) * – WooCommerce-producten (product) * * Doet niets automatisch. * Na activeren: * Gereedschap > Yoast canonicals opschonen V2 */ add_action( ‘admin_menu’, function()…Continue reading
add_action( ‘admin_init’, function () { if ( ! isset( $_GET[‘opcache_status’] ) || ! current_user_can( ‘manage_options’ ) ) { return; } if ( ! function_exists( ‘opcache_get_status’ ) ) { wp_die( ‘OPcache extension not available.’ ); } $s = opcache_get_status( false );…Continue reading
if ( ! function_exists( ‘asj_is_editor_or_preview_request’ ) ) { /** * True for Elementor editor/preview, Gravity Forms preview, * WordPress/Customizer previews and admin requests. */ function asj_is_editor_or_preview_request() { if ( is_admin() || is_preview() || is_customize_preview() ) { return true; } //…Continue reading
/** * REMARK: * Verwijdert uitsluitend returnShippingFeesAmount uit het * Product-schema van WooCommerce en Yoast WooCommerce SEO. * * Dit veld is optioneel. Alle overige product-, verzend- * en retourgegevens blijven ongewijzigd. */ if ( ! function_exists( ‘dv_remove_return_shipping_fees_amount’ ) )…Continue reading