SureCart automatically outputs SEO meta tags for product pages, including title, description, Open Graph tags, and Twitter Card data. These filters let you customize or disable this behavior.
Filter the query variables that trigger a noindex meta tag on product pages. When a URL contains any of these query parameters, SureCart adds <meta name="robots" content="noindex"> to prevent search engines from indexing that page variation.This is useful for preventing duplicate content issues. For example, URLs with tracking parameters, filter states, or session data should typically not be indexed separately from the canonical product page.
Filter the WordPress image size used for Open Graph (og:image) and Twitter Card (twitter:image) meta tags. The Open Graph image is the preview image shown when your product pages are shared on social media platforms like Facebook, LinkedIn, and Twitter.
The WordPress image size name. Default: 'full'. Can be any registered image size: 'thumbnail', 'medium', 'medium_large', 'large', 'full', or custom sizes.
Facebook recommends images at least 1200×630 pixels for optimal display. The 'large' or 'full' sizes typically work best, but if your product images are very high resolution, you may want to use a smaller size to reduce page load time.
// First, register a custom image size optimized for social sharingadd_action( 'after_setup_theme', function() { add_image_size( 'social-share', 1200, 630, true );} );// Then use it for Open Graph imagesadd_filter( 'surecart/og:image/size', function( $size ) { return 'social-share';} );
Control whether JSON-LD schema markup is output for products.
If you’re using a third-party SEO plugin (like Yoast SEO, Rank Math, or All in One SEO) that generates product schema, you should disable SureCart’s schema output to avoid duplicate structured data. Duplicate schema can confuse search engines and negatively impact your SEO.
SureCart integrates with Yoast SEO to provide proper SEO meta data for product pages. These filters allow you to customize how SureCart interacts with Yoast SEO’s presenter system.
Filter the Yoast SEO “presenters” that SureCart uses on product pages. Presenters are Yoast’s system for outputting different types of SEO meta tags (title, description, Open Graph, etc.).By default, SureCart uses a subset of Yoast’s presenters optimized for product pages. This filter lets you modify which presenters are used, allowing you to add custom meta tags or remove ones you don’t need.
If you’re using an SEO plugin that fully supports custom post types, you may want to disable all of SureCart’s SEO output and let your plugin handle everything: