|
Server : LiteSpeed System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64 User : gazetufm ( 1431) PHP Version : 8.1.35 Disable Function : NONE Directory : /home2/gazetufm/dumoshi.com/wp-content/plugins/elementor/modules/agents/classes/ | |
|
Path: //home2/gazetufm/dumoshi.com/wp-content/plugins/elementor/modules/agents/classes/post-noindex.php
Size: 888 B
Permissions: 0644
<?php
namespace Elementor\Modules\Agents\Classes;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Post_Noindex {
/**
* Return true if any active SEO plugin has marked this post as noindex,
* or if the page/post is otherwise excluded from public indexing.
*/
public static function is_noindex( int $post_id ): bool {
if ( '1' === get_post_meta( $post_id, '_yoast_wpseo_meta-robots-noindex', true ) ) {
return true;
}
$rm = get_post_meta( $post_id, 'rank_math_robots', true );
if ( is_array( $rm ) && in_array( 'noindex', $rm, true ) ) {
return true;
}
if ( is_string( $rm ) && false !== strpos( $rm, 'noindex' ) ) {
return true;
}
if ( '1' === (string) get_post_meta( $post_id, '_aioseo_noindex', true ) ) {
return true;
}
if ( 'no' === get_post_meta( $post_id, '_seopress_robots_index', true ) ) {
return true;
}
return false;
}
}