function rubedo_rank_math_normalize_path_url( $url ) {
if ( is_string( $url ) && false !== strpos( $url, ‚/./‘ ) ) {
return str_replace( ‚/./‘, ‚/‘, $url );
}

return $url;
}

function rubedo_rank_math_social_fallback_image() {
return ‚https://rs.p-u4x8ex.project.space/wp-content/uploads/social.jpg‘;
}

function rubedo_rank_math_is_social_archive_fix_target() {
return is_category( array( 1, 5 ) );
}

add_filter( ‚rank_math/frontend/canonical‘, ‚rubedo_rank_math_normalize_path_url‘, 20 );
add_filter( ‚rank_math/opengraph/url‘, ‚rubedo_rank_math_normalize_path_url‘, 20 );

add_filter( ‚rank_math/frontend/title‘, function( $title ) {
if ( is_author() ) {
return ‚Monica Galletti | Rubedo Spa Minden‘;
}

return $title;
}, 20 );

add_filter( ‚rank_math/frontend/robots‘, function( $robots ) {
if ( is_author() ) {
$robots[‚index‘] = ’noindex‘;
$robots[‚follow‘] = ‚follow‘;
}

return $robots;
}, 20 );

add_action( ‚template_redirect‘, function() {
if ( is_admin() || ! is_author() ) {
return;
}

global $wp_query;

if ( $wp_query instanceof WP_Query ) {
$wp_query->set_404();
}

status_header( 404 );
nocache_headers();

$template = get_query_template( ‚404‘ );
if ( $template ) {
include $template;
}

exit;
}, 0 );

add_action( ‚init‘, function() {
if ( get_option( ‚rubedo_seo_fix_archive_social_cache_flushed_v3‘ ) ) {
return;
}

if ( function_exists( ‚wpo_cache_flush‘ ) ) {
wpo_cache_flush();
}

if ( function_exists( ‚WP_Optimize‘ ) ) {
$wp_optimize = WP_Optimize();
if ( is_object( $wp_optimize ) && method_exists( $wp_optimize, ‚get_page_cache‘ ) ) {
$page_cache = $wp_optimize->get_page_cache();
if ( is_object( $page_cache ) && method_exists( $page_cache, ‚purge‘ ) ) {
$page_cache->purge();
}
}
}

if ( function_exists( ‚wp_cache_flush‘ ) ) {
wp_cache_flush();
}

update_option( ‚rubedo_seo_fix_archive_social_cache_flushed_v3‘, time(), false );
}, 1 );

To top