Exclude a Specific Term from the Sitemap

add_filter( ‘aioseo_sitemap_exclude_terms’, ‘aioseo_sitemap_filter_excluded_terms’, 10, 2 ); function aioseo_sitemap_filter_excluded_terms( $ids, $type ) { if ( ‘general’ === $type ) { $ids[] = 412; } return $ids; }Continue reading

Exclude a Specific Post from the Sitemap

add_filter( ‘aioseo_sitemap_exclude_posts’, ‘aioseo_sitemap_filter_excluded_posts’, 10, 2 ); function aioseo_sitemap_filter_excluded_posts( $ids, $type ) { if ( ‘general’ === $type ) { $ids[] = 614; } return $ids; }Continue reading

Append a Page to the Additional Pages Sitemap

add_filter( ‘aioseo_sitemap_additional_pages’, ‘aioseo_sitemap_add_additional_pages’ ); function aioseo_sitemap_add_additional_pages( $pages ) { $pages[] = [ ‘loc’ => ‘https://example.com/additional-page’, ‘lastmod’ => ‘2020-12-11 11:11’, ‘changefreq’ => ‘always’, ‘priority’ => (float) 1.0 ]; return $pages; }Continue reading

Dynamically Add Article Schema to Posts

add_filter( ‘aioseo_schema_graphs’, ‘aioseo_filter_schema_graphs’ ); function aioseo_filter_schema_graphs( $graphs ) { if ( is_singular( ‘post’ ) && ! in_array( ‘Article’, $graphs, true ) ) { $graphs[] = ‘Article’; } return $graphs; }Continue reading

Disable Schema Output for WooCommerce products

add_filter( ‘aioseo_schema_disable’, ‘aioseo_disable_schema_products’ ); function aioseo_disable_schema_products( $disabled ) { if ( is_singular( ‘product’ ) && aioseo()->helpers->isWooCommerceActive() ) { return true; } return $disabled; }Continue reading

Add Noindex & Nofollow Attributes to all the Posts

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { if ( is_singular() ) { $attributes[‘noindex’] = ‘noindex’; $attributes[‘nofollow’] = ‘nofollow’; } return $attributes; }Continue reading

Hide Specific Day From Opening Hours Output

add_filter( ‘aioseo_local_business_output_opening_hours_instance’, ‘aioseo_change_local_business_output_opening_hours_instance’, 10, 3 ); function aioseo_change_local_business_output_opening_hours_instance( $instance, $postId, $openingHoursData ) { $instance[‘showSunday’] = false; return $instance; }Continue reading

Change Opening Hours Closed Label

add_filter( ‘aioseo_local_business_output_opening_hours_data’, ‘aioseo_change_local_business_output_opening_hours_data’, 10, 3 ); function aioseo_change_local_business_output_opening_hours_data( $openingHoursData, $instance, $postId ) { $openingHoursData->labels->closed = __( ‘Closed today.’ ); return $openingHoursData; }Continue reading

Add ‘LLC’ to the Local SEO Business Name

add_filter( ‘aioseo_local_business_output_business_info_location_data’, ‘aioseo_change_local_business_output_business_info_location_data’, 10, 3 ); function aioseo_change_local_business_output_business_info_location_data( $locationData, $instance, $postId ) { $locationData->name .= ‘ LLC’; return $locationData; }Continue reading