WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Change the posts url in the sitemap? (2 posts)

  1. nicolasaiz173
    Member
    Posted 11 months ago #

    Hi!

    We are working in a project where the front-end is made in AngularJS, so the front-end URL is different of the wordpress installation because they are separated one from another. We need to change the default URL site-map in order to customize it and make it according to the front-end.

    In the class-sitemaps.php we added this hook in the sitemap_url function:

    function sitemap_url( $url ) {
    		if ( isset( $url['mod'] ) )
    			$date = mysql2date( "Y-m-d\TH:i:s+00:00", $url['mod'] );
    		else
    			$date = date( 'c' );
    
    		// This hook has been created for edit the sitemap url for each post.
    		$url = apply_filters('wpseo_sitemap_url', $url);
    
    		$url['loc'] = htmlspecialchars( $url['loc'] );

    Also we found this actions but I think we don't need it.

    There is better way to do this? Without touching the plugin core files?

    Thanks

    http://wordpress.org/plugins/wordpress-seo/

  2. nicolasaiz173
    Member
    Posted 11 months ago #

    I used the filters: post_link, post_type_link, category_link and tag_link. So now the plugin stays untouched.

Reply

You must log in to post.

About this Plugin

About this Topic