# wp-commerce7/trunk/includes/seopress/load.php

Commerce7 for WordPress, version trunk. 48 lines.

- Page: https://pluginprobe.com/plugins/wp-commerce7/trunk/code/includes/seopress/load.php
- Raw: https://pluginprobe.com/plugins/wp-commerce7/trunk/raw/includes/seopress/load.php
- Modified: 2026-06-05T01:20:22+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/wp-commerce7/trunk/code/includes/seopress/load.php#L10-L20`.

```php
<?php
/**
 * Rankmath Support
 *
 * Created Date: Wednesday October 12th 2022
 * Author: Michael Bourne
 * -----
 * Last Modified: Wednesday, February 11th 2026, 8:27:21 pm
 * Modified By: Michael Bourne
 * -----
 * Copyright (c) 2022 URSA6
 *
 * @package   wp-commerce7
 * @author    Michael Bourne
 * @license   GPL3
 * @link      https://ursa6.com
 * @since     1.3.3
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

add_filter(
	'seopress_titles_canonical',
	function ( $html ) {

		$options = get_option( 'c7wp_settings' );

		// If the user has not set custom routes, use the defaults.
		if ( ! isset( $options['c7wp_frontend_routes'] ) || ! is_array( $options['c7wp_frontend_routes'] ) ) {
			$product_route    = 'product';
			$collection_route = 'collection';
		} else {
			$product_route    = $options['c7wp_frontend_routes']['product'];
			$collection_route = $options['c7wp_frontend_routes']['collection'];
		}

		// If the current page is a product or collection page, return false to disable canonical URL.
		if ( is_page( array( $product_route, $collection_route ) ) ) {
			return false;
		}

		return $html;
	},
	20
);

```
