/** * Keep the Piano Care URL consistent in cached Elementor HTML. */ function vbpt_piano_care_url_in_elementor( $content, $widget ) { if ( is_string( $content ) && false !== strpos( $content, '/blog/' ) ) { $content = str_replace( '/blog/', '/piano-care/', $content ); $content = str_replace( 'Piano Care Blog', 'Piano Care', $content ); } return $content; } add_filter( 'elementor/widget/render_content', 'vbpt_piano_care_url_in_elementor', 20, 2 ); /** * Redirect the retired Blog URL. */ function vbpt_redirect_old_blog_url() { if ( '/blog/' === wp_parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ) ) { wp_safe_redirect( home_url( '/piano-care/' ), 301 ); exit; } } add_action( 'template_redirect', 'vbpt_redirect_old_blog_url' ); Florida Humidity and Your Piano – Javier & Paul