• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Abstract_Indexing_Action::get_total_unindexed() – Returns the total number of unindexed posts.

You appear to be a bot. Output may be restricted

Description

Returns the total number of unindexed posts.

Usage

$int|false = Abstract_Indexing_Action::get_total_unindexed();

Parameters

Returns

int|false The total number of unindexed posts. False if the query fails.

Source

File name: wordpress-seo/src/actions/indexing/abstract-indexing-action.php


Lines:

1 to 24 of 24
  public function get_total_unindexed() {
    $transient = \get_transient( static::UNINDEXED_COUNT_TRANSIENT );
    if ( $transient !== false ) {
      return (int) $transient;
    }

    // Store transient before doing the query so multiple requests won't make multiple queries.
    // Only store this for 15 minutes to ensure that if the query doesn't complete a wrong count is not kept too long.
    \set_transient( static::UNINDEXED_COUNT_TRANSIENT, 0, ( \MINUTE_IN_SECONDS * 15 ) );

    $query = $this->get_count_query();

    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Function get_count_query returns a prepared query.
    $count = $this->wpdb->get_var( $query );

    if ( \is_null( $count ) ) {
      return false;
    }

    \set_transient( static::UNINDEXED_COUNT_TRANSIENT, $count, \DAY_IN_SECONDS );

    return (int) $count;
  }
 

 View on GitHub View on Trac

Published: 12th September 2021 | Last updated: 14th November 2021

Primary Sidebar

Information

Function name: Abstract_Indexing_Action::get_total_unindexed
Class ref: Abstract_Indexing_Action
Plugin ref: Yoast SEO
Version: 20.2.1
Sourcefile: src/actions/indexing/abstract-indexing-action.php
File ref: src/actions/indexing/abstract-indexing-action.php
Deprecated?: No
API Letters: A,G,I,T

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 6.2.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites