Remove wpseo filter from polylang plugin

2 weeks ago 21

in polylang determination is an integration record for yoast named wpseo.php that adds immoderate translated urls to yoast sitemap, I don't privation these urls since I'm doing a customized enactment connected translations with my ain classes, the filter is this

/** * Add filters earlier the sitemap is evaluated and outputted. * * @since 2.6 * * @param WP_Query $query Instance of WP_Query being filtered. */ public relation before_sitemap( $query ) { $type = $query->get( 'sitemap' ); // Add the station post benignant archives successful each languages to the sitemap // Add the homepages for each languages to the sitemap erstwhile the beforehand leafage displays posts if ( $type && pll_is_translated_post_type( $type ) && ( 'post' !== $type || ! get_option( 'page_on_front' ) ) ) { add_filter( "wpseo_sitemap_{$type}_content", array( $this, 'add_post_type_archive' ) ); } }

How tin I region this filter though my functions.php file?

Read Entire Article