# woocommerce-pos/1.10.16/includes/Integrations/WPSEO.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.16. 42 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.16/code/includes/Integrations/WPSEO.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.16/raw/includes/Integrations/WPSEO.php
- Modified: 2026-02-06T20:51:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.16/code/includes/Integrations/WPSEO.php#L10-L20`.

```php
<?php
/**
 * WPSEO.
 *
 * @package WCPOS\WooCommercePOS
 */

namespace WCPOS\WooCommercePOS\Integrations;

/**
 * Yoast SEO Integration
 */
class WPSEO {
	/**
	 * Constructor.
	 */
	public function __construct() {
		add_filter( 'option_wpseo', array( $this, 'remove_wpseo_rest_api_links' ), 10, 1 );
	}

	/**
	 * Yoast SEO adds SEO to the WC REST API by default, this adds to the download weight and can cause problems.
	 * It is programmatically turned off here for POS requests.
	 * This gets loaded and cached before the rest_api init hook, so we can't use the filter.
	 *
	 * QUESTION: How long is the WPSEO_Options cache persisted?
	 *
	 * @param array $wpseo_options The WPSEO options array.
	 */
	public function remove_wpseo_rest_api_links( $wpseo_options ) {
		$wpseo_options['remove_rest_api_links'] = false; // needed for WC API discovery.

		if ( woocommerce_pos_request() ) {
			$wpseo_options['remove_rest_api_links'] = true;
			$wpseo_options['enable_headless_rest_endpoints'] = false;
			return $wpseo_options;
		}

		return $wpseo_options;
	}
}

```
