28 pointsStarting to get into this DEV thingI'm helpful
boowp
Member
—
27th March 2011 (1 year ago)
Hello,
pls note below improvement of sitemap generarion.
Because of domains mapped on main main blog where a blog have HIS own domain mapped the sitemap should be generated with a permalink refer to that domain and not a subdirectory.
here is an excample
suppose domain.com is main domain host the wp mu
and http://domain.com/blog1 without a mapped domain the permalinks will be http://domain.com/blog1/xxxxx and so on. thats is ok
BUT if a domain is mapped on that blog1, suppose blog1.com so the permalinks should be http://blog1.com/xxxxx
unable to find a wp get_permalink function domain mapped 'aware', the simple-sitemaps.php has been changed in this way (feel free to update your code without quote the author)
under the var totalposts note added code:
class Incsub_SimpleSitemaps {
var $totalposts = 50; // Number of posts to display
private $map_domain_blog_url, $blog_url;
function __construct() {
global $wpdb;
$this->map_domain_blog_url = "http://" . $wpdb->get_var( "SELECT domain FROM {$wpdb->dmtable} WHERE blog_id = '{$wpdb->blogid}'" ) . "/";
$this->blog_url = get_blogaddress_by_id($wpdb->blogid);
}
then added code before writefile function:
// Convert main blog based permalink to domain mapped permalink
function get_permalink_dom( $id ){
global $wpdb;
then simply replace get_permalink calls in your code with $this->get_permalink_dom( $post->ID )
And now, each domain blog based sitemap, have inside links based on that domain !!!
many thanks!
any subscription extension if granted, will be appreciated. or use the code updateding your plugin and reflect on each other use non domain based links. where personally hided to search engines. because any blogs should expose only its own domain based links...
pls note below improvement of sitemap generarion.
Because of domains mapped on main main blog where a blog have HIS own domain mapped the sitemap should be generated with a permalink refer to that domain and not a subdirectory.
here is an excample
suppose domain.com is main domain host the wp mu
and http://domain.com/blog1 without a mapped domain the permalinks will be http://domain.com/blog1/xxxxx and so on. thats is ok
BUT if a domain is mapped on that blog1, suppose blog1.com so the permalinks should be http://blog1.com/xxxxx
unable to find a wp get_permalink function domain mapped 'aware', the simple-sitemaps.php has been changed in this way (feel free to update your code without quote the author)
under the var totalposts note added code:
class Incsub_SimpleSitemaps {
var $totalposts = 50; // Number of posts to display
private $map_domain_blog_url, $blog_url;
function __construct() {
global $wpdb;
$this->map_domain_blog_url = "http://" . $wpdb->get_var( "SELECT domain FROM {$wpdb->dmtable} WHERE blog_id = '{$wpdb->blogid}'" ) . "/";
$this->blog_url = get_blogaddress_by_id($wpdb->blogid);
}
then added code before writefile function:
// Convert main blog based permalink to domain mapped permalink
function get_permalink_dom( $id ){
global $wpdb;
then simply replace get_permalink calls in your code with $this->get_permalink_dom( $post->ID )
And now, each domain blog based sitemap, have inside links based on that domain !!!
many thanks!
any subscription extension if granted, will be appreciated. or use the code updateding your plugin and reflect on each other use non domain based links. where personally hided to search engines. because any blogs should expose only its own domain based links...
Any suggest on how to convert permalinks in other plugins also to reflect the site domain and not the main wp mu domain is appreciated if used different way than above exposed.
thanks
Chris,
just have in mind all plugin that expose to the web the 'wrong' link.
because if I create a minisite or blog like some-useful-stuff.info
I wanto to see on http://some-useful-stuff.info ALL links related to some-useful-stuff.info domain and not wpmaindomain.com/some-useful-stuff or http://some-useful-stuff.wpmaindomain.com
bad look and bad seo. all post links , page links, 'any' link should have as url base http://some-useful-stuff.info
In this case the site map generation has been updated. All wp mu post and page permalinks are really ok on blog where domain is mapped.
But sitemap file generated use permalinks based on main domain only.
Now I feel, is correct. (my first plugin code touch. just php,perl,c,pascal experience. no wordpress)
In wordpress api and function list I see no permalink function domain mapped 'aware', or anyway looks with domain mapped url based ONLY inside wp posts and pages. not when the file is generated, like in sitemap.xml. I let you know if any issue with other plugins here.
Many thanks for all your work there boowp! We'll notify the developers on this though I should say, we've rather focused heavily on WPMU DEV SEO as a massive update for the older, though still useful, Sitemaps plugin. http://premium.wpmudev.org/project/wpmu-dev-seo
Responses (6)
Member — 27th March 2011 (1 year ago) #
Any suggest on how to convert permalinks in other plugins also to reflect the site domain and not the main wp mu domain is appreciated if used different way than above exposed.
thanks
Member — 27th March 2011 (1 year ago) #
try to upload simple-sitemaps.php again...
Member — 27th March 2011 (1 year ago) #
zipped !
the zip contain the simple-sitemaps.php to be replaced.
Member — 27th March 2011 (1 year ago) #
That looks like a useful code suggestion. Thanks for offering it to the community! Regarding other plugins, are there certain ones you have in mind?
Member — 27th March 2011 (1 year ago) #
Chris,
just have in mind all plugin that expose to the web the 'wrong' link.
because if I create a minisite or blog like some-useful-stuff.info
I wanto to see on http://some-useful-stuff.info ALL links related to some-useful-stuff.info domain and not wpmaindomain.com/some-useful-stuff or http://some-useful-stuff.wpmaindomain.com
bad look and bad seo. all post links , page links, 'any' link should have as url base http://some-useful-stuff.info
In this case the site map generation has been updated. All wp mu post and page permalinks are really ok on blog where domain is mapped.
But sitemap file generated use permalinks based on main domain only.
Now I feel, is correct. (my first plugin code touch. just php,perl,c,pascal experience. no wordpress)
In wordpress api and function list I see no permalink function domain mapped 'aware', or anyway looks with domain mapped url based ONLY inside wp posts and pages. not when the file is generated, like in sitemap.xml. I let you know if any issue with other plugins here.
WPMU DEV Fanatic — 15th April 2011 (1 year ago) #
Many thanks for all your work there boowp! We'll notify the developers on this though I should say, we've rather focused heavily on WPMU DEV SEO as a massive update for the older, though still useful, Sitemaps plugin.
http://premium.wpmudev.org/project/wpmu-dev-seo
Become a member