Archived Page

You're reading an archived page of the site. The content is probably out of date. Try the homepage for more current content.

SH Global Posts

Please Note: This is a WordPress MU plugin, do not install it on a standalone version of WordPress. WPMU and this plugin require some PHP knowledge. It’s not intended for end users. You have been warned! 🙂


This plugin requires the Real Global Terms plugin to be installed.

This plugin will make a copy of every post, on every blog, and put all those copies into one, single blog. It will copy the post as well as the post’s tags and categories. This means that you can search the single blog for all posts across all blogs across your whole site. Likewise for categories and tags. This also means your global blog feed will include all the posts for your whole site.

Each of the copied posts links back to the original post’s permalink. This means the global feed points to each individual post on each individual blog. The plugin also redirects any requests for individual posts on the global blog to the original blog. This should avoid the duplicate content penalty, and ensure all your comments / trackbacks / pingbacks / etc are in one place.

When the post is copied to the global posts, comments and pingbacks are automatically closed, as they should go to the original post.


By default the global blog is blog ID 1, which is normally the main site. However, you can change that. Simply add this line to your wp-config.php file:

define('GLOBAL_POSTS_BLOG_ID', 1);

Obviously you need to change 1 to be the ID of the blog you’d like to be the global blog! 🙂

Alternatively you can set the default blog in a site option with the name ‘global_posts_blog_id’. Currently (May 2008) there is no easy way to set site options from the admin interface, so the first option is probably easier. However, if you want to set it manually, the SQL is probably:

INSERT INTO wp_sitemeta (site_id, meta_key, meta_value) VALUES (1,'global_posts_blog_id','XXX');

Again, obviously you need to change XXX to the be the ID of the global blog. If you’re not using ‘wp_’ as your table prefix, you will also need to change the table name. If this stuff is all beyond you, this plugin is not for you I’m afraid.

MU Plugins

This plugin must be installed for all blogs on your site, so it must be in the ‘wp-content/mu-plugins’ directory. If you install it in the ‘wp-content/plugins’ directory the world may very well end. 🙂


I’m happy to answer developer questions here and there, but I can’t provide end user support for this plugin. If you can’t read the code and understand what it does, I’d suggest avoid using the plugin. If you ask me very nicely and promise to send me chocolate cake, I might be able to help. But it’s strictly at your own risk. Please post any questions in the comments on this page.


If you have made it this far and still want to proceed, please go ahead and download the code here. I’d strongly recommend you subscribe to this feed to be kept informed about updates to the plugin.


This plugin was created as part of my work with SmartHippo. If you’d like to show gratitude, please register with SmartHippo and post a rate.


0.2.2 – Added a generic filter to allow blog exclusion

0.2.1 – Added ignore mature option

0.2 – First public release


george at 2008-06-08 03:39:20

Great plugin. thank you. if i use this method will i be able to search custom fields using a search custom-fields plugin? i.e. does the plugin import meta data as well? is unborked at 2008-06-19 15:22:44

[...] global posts plugin I mentioned; I tried it out and it borked the categories (I’ve got to stop saying that). So I [...]

Callum at 2008-06-08 11:57:38

@<a href="" rel="nofollow">george</a>: No, it doesn't currently copy metadata. It wouldn't be a major task to add that to the plugin though. It copies the term_relationships, so it could copy post_meta in the same way.

george at 2008-06-10 20:32:40

Would that be a feature we can expect in the future? or is there way i can include it into the existing plugin?

Callum at 2008-06-10 21:08:43

@<a href="" rel="nofollow">george</a>: You could add it to the plugin quite easily. It's something I could add if I had time, but I'm not sure when that would be. I published these plugins to put them out there, I'm not looking to maintain them. If you do add the functionality, I'll be happy to include it in the original plugin with a credit.

george at 2008-06-10 21:42:12

as of now when i set it up the "global posts blog" puts all the posts under uncategorized(including from sub blogs). is this how it is supposed to be or am i doing something wrong? tags from sub blogs are not appearing either. any thoughts?

george at 2008-06-10 22:56:30

i understand mate, appreciate the help. cheers.

Callum at 2008-06-11 14:23:06

@<a href="" rel="nofollow">george</a>: All the posts are appearing under uncategorized on the global blog? That's definitely not right. I'd suggest debugging as follows: 1) Are the site_terms and site_term_taxonomy tables being populated? 2) Are the IDs being kept in sync with those tables and the individual blog terms / term_taxonomy tables? 3) Is the global blog's term_relationships table being populated?

Cretch at 2008-05-27 19:44:25

Seems REALLY cool ;) Gonna install it Thank you very much Callum

Callum at 2008-10-08 10:41:45

@<a href="" rel="nofollow">Deryk</a>: The plugin creates a duplicate post on the main blog. The posts are linked by their guid. The plugin also pushes updates to the posts. So if a post is changed, it will be updated on the main blog. I believe the plugin does work with the latest version of WPMU, but I haven't thoroughly tested it yet.

Callum at 2008-10-07 14:10:31

@<a href="" rel="nofollow">Deryk</a>: I'm not familiar with the other plugin, so I'm not sure how they compare. The plugin will allow you to push all posts from all your blogs onto one single blog. Then you can do any of the usual stuff with those posts on the global blogs (show tag pages, search, etc).

Guas at 2008-10-15 03:49:35

I need to create any table to this plugin works?

demonicume at 2008-05-29 20:30:15

this line is bringing my site down. 'define ( 'REAL_GLOBAL_TERMS_INSTALLED', false );' when its set to false, my site goes down. when set to true, the site comes up. here are a couple of lines from my DB [28-May-2008 18:38:36] WordPress database error Table 'database.wp_site_term_taxonomy' doesn't exist for query INSERT INTO wp_site_term_taxonomy ( term_id, taxonomy, parent ) VALUES ( '14013', 'category', '0' ) made by global_term_taxonomy [28-May-2008 18:38:36] WordPress database error: [Table &#39;database.wp_site_term_taxonomy&#39; doesn&#39;t exist] [28-May-2008 18:38:36] WordPress database error Duplicate entry '229-0' for key 1 for query UPDATE wp_29_term_relationships SET term_taxonomy_id = '' WHERE term_taxonomy_id = '432' made by global_term_taxonomy [28-May-2008 18:38:36] WordPress database error: [Duplicate entry &#39;229-0&#39; for key 1] UPDATE wp_29_term_relationships SET term_taxonomy_id = &#39;&#39; WHERE term_taxonomy_id = &#39;432&#39;

Callum at 2008-05-30 00:21:26

@<a href="" rel="nofollow">demonicume</a>: You don't want it set to false, that means that the plugin has not been installed. You'd only ever want to set it to true. As soon as you hit one page on one site, the plugin will do all it's installation stuff. So you'd only ever want it set to true after the tables have been created. Does your database user have create table privileges? It looks like the new tables are not being created properly. You could try creating them manually, but the plugin should auto create them on first run. Do you have any logs with CREATE TABLE queries?

Deryk at 2008-10-07 23:37:37

hey callum, thanks for the reply. the other plugin works quite well for new sites in that on every post creation or save it copies the post to a central blog. however it does not work well if you need to convert an existing site. my question: does your plugin work with the latest version of wpmu 2.6? and does it copy the posts or just reference them somehow within the existing blog? ie. how does it deal with duplication? many thanks.

Callum at 2008-10-10 09:55:03

@<a href="" rel="nofollow">Guas</a>: No idea. This plugin is aimed at developers. If you can provide specific error messages or a cause of the error, I may be able to help.

Guas at 2008-10-10 07:02:07

Hi, I installed this plugin, but doesn't work, Will not let me create categories, why?

Deryk at 2008-10-04 02:59:15

excuse my ignorance in this subject. I'm thinking that your plugin will be right for what I need to do, which is intelligently gather posts from many sub blogs in MU and post the results in one main blog. I'd like to add moderation (<a href="" rel="nofollow"></a>) as well as view posts by category. Does the new wordpress update already do this? Or does this plugin (<a href="" rel="nofollow"></a>) differ very much from yours. thanks very much! <em>Admin: Comment edited, link added as per follow up comment.</em>

Callum at 2008-10-15 11:13:11

@<a href="" rel="nofollow">Guas</a>: No need to create tables. However, I'd strongly recommend you read and understand the code before using it. I publish it here really as a source for developers. The plugins are not very "polished". :)

1stangel at 2008-10-16 02:49:18

Hi :) I have uploaded this to my site in the correct folder but am not seeing anything. I now cannot create categories either LOL So I have the plugin installed I should imagine but there are no settings for it and my category making is now defunct. Where SHOULD the settings be? Any help gratefully received :)

Callum at 2008-10-20 20:53:46

@<a href="" rel="nofollow">1stangel</a>: Check your PHP error logs for messages. Without an error message there's not much I can do to help.