progamatically adding pages to the sitemap using aiosp_sitemap_addl_pages | General - All in One SEO Pack Pro Forum | Support | Semper Plugins

Avatar
Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
progamatically adding pages to the sitemap using aiosp_sitemap_addl_pages
August 24, 2017
9:32 pm
Avatar
Steve Vale
New Member
AIOSEOP
Forum Posts: 2
Member Since:
October 27, 2016
sp_UserOfflineSmall Offline

I am trying to programatically add additional pages to the sitemap that do not exist as wordpress posts/pages. There are too many to do this manually via the Additional Pages section.

I saw the suggestion here https://semperplugins.com/docu…..ddl_pages/ which has the following example code

add_filter( ‘aiosp_sitemap_addl_pages’, ‘sfwd_add_pages’ );
function sfwd_add_pages( $pages ) {
    if ( empty( $pages ) ) $pages = Array();
    $pages[] = Array( “loc” => “http://www.google.com/”, “lastmod” => “2014-04-01T00:00:00Z”, “changefreq” => “daily”, “priority” => “0.1” );
    return $pages;
}

As a test I added this to my functions.php, and used “http://mysite.com/hello/” in place of google in the sample so it was the same domain as my wordpress site and specified a page that did not exist in wordpress. However, it did not result in this page being included in the sitemap.xml file.

Has this changed, or is there a different way to add pages now (given this sample is a few years old)?

Thanks

Steve

August 24, 2017
10:29 pm
Avatar
Michael Torbert
Admin
Forum Posts: 449
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

August 24, 2017
10:39 pm
Avatar
Michael Torbert
Admin
Forum Posts: 449
Member Since:
October 13, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

August 24, 2017
11:29 pm
Avatar
Steve Vale
New Member
AIOSEOP
Forum Posts: 2
Member Since:
October 27, 2016
sp_UserOfflineSmall Offline

Thanks for the quick update Michael

After further searching, I found this, which works and does what I need

https://wordpress.stackexchang…..225#140225

Forum Timezone: America/New_York
Most Users Ever Online: 964
Currently Online:
17
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Member Stats:
Guest Posters: 36
Members: 22824
Moderators: 0
Admins: 8
Forum Stats:
Groups: 4
Forums: 28
Topics: 2095
Posts: 9107
Newest Members:
Alicia Kacine
Administrators: Michael TorbertPeter BayliesSupport TeamSteve MortiboyMatthew RobinsonSteve Klasen, Arnaud: 239Ashish Ravi
[i]
[i]
Skip to toolbar