How can I pull metadata from posts that have been indexed using the Post Indexer Plugin?

How can I pull metadata from posts that have been indexed using the Post Indexer Plugin?

There seem to be duplicate functions for most post related functions... i.e. "network_get_the_terms" to replace "get_the_terms". (brilliant).

I see that the metadata is getting copied over into a new table called "wp_network_postmeta", so I was hoping I could use a function like "network_get_post_meta", but no dice.

Any ideas? I see that it may be doable via switch_to_blog, but I'd rather just pull it from the new table if it's there. Any ideas?


  • Paul
    • The Green Incsub


    Wanted to jump in an provide some direction while you are waiting on Barry. With the new Post Indexer there is a way to query the tables without resulting to direct SQL calls.

    If you are familiar with the builtin WordPress WP_Query ( ) usage? If so then you would setup your query arguments/array the same way.

    Then instead of calling

    $query = new WP_Query($args);

    You would call the Post Indexer 'Network_Query' function.

    $query = new Network_Query($args);

  • gabemortoncook
    • WPMU DEV Initiate

    Thanks Paul.

    I appreciate the quick reply, but I'm not sure that's quite what I'm looking for.

    I've been able to use network_query_posts to get all the posts from the new network tables. I am then using a custom loop to set up the display of the posts.

    What I'd like to do is display some metadata for each post, which I would do on the networked sites just by calling echo(get_post_meta($post->ID, 'my_meta_key', true);

  • Mike
    • New Recruit

    Hi there,

    We're just doing a little housekeeping to see if we have dropped the ball anywhere. We haven't replied here for over 5 months which is obviously not good enough. And I apologise for that.

    Do you still have this issue? I've had a look and I see that there have been 4 new versions since you posted this and you are currently using the latest so I was wondering if this has been added as far as you know?

    I'm going to mark this as resolved, but if it hasn't been please post a reply and I will change it back and try to get @Barry involved again.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.