• Resolved omris83

    (@omris83)


    If I have multiple wordpress installations, but they all appear on one domain in sibdirectories (for demo purposes) is there a way to manually add URLs in the main domain’s plugin?

    Essentially I have

    domain.com with AIO SEO
    domain.com/example (but this is a seperate wordpress installation)

    I need the domain.com main site to show all pages. Not sure how this can be done?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    You should be able to pull it off using this filter hook – https://aioseo.com/docs/aioseo_sitemap_additional_pages/

    I included an example code snippet on the page that you should be able to use; you just need to change it to your domain.

    – Arnaud

    Thread Starter omris83

    (@omris83)

    Hey @arnaudbroes , thanks for the reply ??

    So to confirm, if I want to add more than one page, do I need to do this?

    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'   => '1.0',
    		'loc'        => 'https://example.com/additional-page2',
    		'lastmod'    => '2020-12-11 11:11',
    		'changefreq' => 'always',
    		'priority'   => '1.0',
    	];
    	return $pages;
    }

    Also, I assume I just add this in functions.php on the main site and don’t include AIO SEO on the additional sites?

    Plugin Author arnaudbroes

    (@arnaudbroes)

    If you want to add more than one page, you need to do something like this –

    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'   => '1.0'
    	];
    	$pages[] = [
    		'loc'        => 'https://example.com/additional-page2',
    		'lastmod'    => '2020-12-11 11:11',
    		'changefreq' => 'always',
    		'priority'   => '1.0'
    	];
    	return $pages;
    }

    And yep, your main site’s child theme’s functions.php file would be ideal! If you don’t need SEO for subsites, you can disable AIOSEO.

    – Arnaud

    Thread Starter omris83

    (@omris83)

    Thank you so much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add pages manually to sitemap? multiple WP installations’ is closed to new replies.