This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'seopress_pro_video_sitemap_builder_content', 'sp_pro_video_sitemap_builder_content', 10, 2 ); | |
| function sp_pro_video_sitemap_builder_content( $buffer, $post_id ) { | |
| // Adjust the <video:video> entries generated for this post. | |
| return $buffer; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'seopress_ai_assistant_request_args', 'sp_ai_assistant_request_args', 10, 2 ); | |
| function sp_ai_assistant_request_args( $args, $provider ) { | |
| // Increase the timeout for AI Assistant requests. | |
| $args['timeout'] = 60; | |
| return $args; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'seopress_sitemap_diagnostic_request_args', 'sp_sitemap_diagnostic_request_args', 10, 2 ); | |
| function sp_sitemap_diagnostic_request_args( $args, $url ) { | |
| // Give the health check more time on slow servers. | |
| $args['timeout'] = 30; | |
| return $args; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'seopress_abilities_api_rest_enabled', 'sp_abilities_api_rest_enabled', 10, 1 ); | |
| function sp_abilities_api_rest_enabled( $enabled ) { | |
| // Expose the SEOPress abilities over REST only on staging. | |
| if ( 'staging' === wp_get_environment_type() ) { | |
| return true; | |
| } | |
| return $enabled; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'seopress_agent_ready_markdown_post_types', 'sp_agent_ready_markdown_post_types', 10, 1 ); | |
| function sp_agent_ready_markdown_post_types( $types ) { | |
| $types[] = 'your_cpt_key'; | |
| $types[] = 'your_cpt_key_2'; | |
| return $types; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * SEOPress PRO — Always send the parent product ID to Google Analytics 4. | |
| * | |
| * By default SEOPress sends the variation SKU (or, as fallback, the variation ID) | |
| * for each line item in a WooCommerce order. Some shops prefer to aggregate | |
| * analytics at the parent product level — e.g. a single "Blue T-Shirt" row in GA4 | |
| * instead of one row per size / color variation. This snippet returns the SKU | |
| * (or ID) of the parent product whenever a variation is purchased. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * SEOPress PRO — Last-resort post ID resolver for Search Console rows via Polylang. | |
| * | |
| * When url_to_postid() returns 0 (typically because the URL belongs to a translation | |
| * whose permalink is owned by the multilingual plugin), this snippet asks Polylang | |
| * to resolve the URL using its own router. The resolved post then receives the | |
| * GSC metrics (clicks, impressions, CTR, position) on each daily sync. | |
| * | |
| * Hook: seopress_search_console_match_post_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * SEOPress PRO — Strip the language prefix from Search Console URLs before matching. | |
| * | |
| * Multilingual plugins (Polylang, WPML, TranslatePress…) prepend a language segment | |
| * (e.g. /en/, /fr/) to public URLs but do not register that segment in WP_Rewrite. | |
| * As a result, url_to_postid() cannot match the raw URL returned by Google Search | |
| * Console. This snippet removes a known list of language prefixes so SEOPress can | |
| * resolve the WordPress post and store GSC impressions / clicks / CTR / position | |
| * against it. |
NewerOlder