AIOSEO – Increase SEO Analyzer TimeOut

add_filter( ‘http_request_args’, ‘aioseo_filter_analyzer_timeout’, 1, 2 ); function aioseo_filter_analyzer_timeout( $args, $url ) { if ( ‘https://analyze.aioseo.com/v1/analyze/’ === $url ) { $args[‘timeout’] = 120; } return $args; }Continue reading

Change Schema Type of All Posts in Specific Categories

add_filter(‘aioseo_schema_output’, ‘change_schema_type_in_specific_categories’); function change_schema_type_in_specific_categories($schema) { // Specify the category slugs you want to target $target_category_slugs = array(‘category1-slug’, ‘category2-slug’, ‘category3-slug’); foreach ($schema as &$schemaItem) { // Check if the post belongs to any of the specified categories if (isset($schemaItem[‘@type’]) && ‘NewsArticle’…Continue reading

Shortcode to get all taxonomy values of current post

function display_post_artists_shortcode() { // Get the terms (artists) of the “artist” taxonomy for the current post $artists = get_the_terms(get_the_ID(), ‘artist’); // Check if artists exist if ($artists && !is_wp_error($artists)) { // Start building the output $output = []; // Loop…Continue reading

Showcase IDX plugin – Replace all Permalink URLs with current URL in Schema

add_filter( ‘aioseo_schema_output’, ‘aioseo_schema_change_urls’ ); function aioseo_schema_change_urls( $graphs ) { if ( false === strpos( $_SERVER[‘REQUEST_URI’], ‘search-results/listing/’ ) ) { return $graphs; } $request_uri = explode( ‘?’, $_SERVER[‘REQUEST_URI’] ); $request_uri = explode( ‘#’, $request_uri[0] ); $url_parts = trim($request_uri[0], ‘/’); $url_parts =…Continue reading

Remove #listItem from Breadcrumb schema

add_filter(‘aioseo_schema_output’, ‘aioseo_schema_remove_list_item’); // Callback function to remove ‘#listItem’ from URLs in BreadcrumbList function aioseo_schema_remove_list_item($graphs) { // Loop through each element in the array foreach ($graphs as $index => $value) { // Check if the key ‘@type’ is set and its…Continue reading

Showcase IDX plugin – Replace all Permalink URLs with current URL in Schema

add_filter( ‘aioseo_schema_output’, ‘aioseo_schema_change_urls’ ); function aioseo_schema_change_urls( $graphs ) { if ( false === strpos( $_SERVER[‘REQUEST_URI’], ‘search-results/listing/’ ) ) { return $graphs; } $request_uri = explode( ‘?’, $_SERVER[‘REQUEST_URI’] ); $request_uri = explode( ‘#’, $request_uri[0] ); $url_parts = trim($request_uri[0], ‘/’); $url_parts =…Continue reading

Remove aggregateRating schema when review schema is missing

add_filter( ‘aioseo_schema_output’, ‘product_schema_remove_aggregate’ ); function product_schema_remove_aggregate( $schema ) { foreach ( $schema as &$schemaItem ) { if ( ‘Product’ === $schemaItem[‘@type’] ) { if(!isset($schemaItem[‘review’])){ unset ($schemaItem[‘aggregateRating’]); } } } return $schema; }Continue reading

Remove AggregateRating and Reviews Schema

add_filter( ‘aioseo_schema_output’, ‘product_schema_aggregate_reviews’ ); function product_schema_aggregate_reviews( $schema ) { foreach ( $schema as &$schemaItem ) { if ( ‘Product’ === $schemaItem[‘@type’] ) { unset ($schemaItem[‘aggregateRating’]); unset ($schemaItem[‘review’]); } } return $schema; }Continue reading