• 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 / Index_Command::index() – Indexes all your content to ensure the best performance.

You appear to be a bot. Output may be restricted

Description

Indexes all your content to ensure the best performance.

OPTIONS

[–network] : Performs the indexation on all sites within the network. [–reindex] : Removes all existing indexables and then reindexes them. [–skip-confirmation] : Skips the confirmations (for automated systems). [–interval=<interval>] : The number of microseconds (millionths of a second) to wait between index actions. — default: 500000 —

EXAMPLES

  • wp yoast index

Usage

$void = Index_Command::index( $args, $assoc_args );

Parameters

$args
( array|null ) optional – The arguments.
$assoc_args
( array|null ) optional – The associative arguments.

Returns

void

Source

File name: wordpress-seo/src/commands/index-command.php
Lines:

1 to 22 of 22
  public function index( $args = null, $assoc_args = null ) {
    if ( ! isset( $assoc_args['network'] ) ) {
      $this->run_indexation_actions( $assoc_args );

      return;
    }

    $criteria = [
      'fields'   => 'ids',
      'spam'     => 0,
      'deleted'  => 0,
      'archived' => 0,
    ];
    $blog_ids = \get_sites( $criteria );

    foreach ( $blog_ids as $blog_id ) {
      \switch_to_blog( $blog_id );
      \do_action( '_yoast_run_migrations' );
      $this->run_indexation_actions( $assoc_args );
      \restore_current_blog();
    }
  }
 

 View on GitHub View on Trac

Published: 2nd May 2020 | Last updated: 21st August 2020

Primary Sidebar

Information

Function name: Index_Command::index
Class ref: Index_Command
Plugin ref: Yoast SEO
Version: 20.2.1
Sourcefile: src/commands/index-command.php
File ref: src/commands/index-command.php
Deprecated?: No
API Letters: C,I

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