I am trying to access selected post information from my WordPress database to display on a second website which is not a WordPress site nor is it php, it is in fact an asp.net website that i want to display the information on.

I have a WordPress blog at blog.domain.com and another website at domain.com both running on different servers and I need to display the excerpt, title with link on my asp.net website for selected posts. I can easily grab the excerpt and title from the blog's database but the only problem is that the permalink is not in the database.

I had the idea that maybe if I place a short piece of code on every blog to insert the permalink to a new table, i could then grab that to use over on the other website. But that didnt work, perhaps I am not doing it right. This is the code I used and I placed this within the loop on the template file for the page I was testing on.

  global $wpdb; 
  $table_name = $wpdb->prefix . "posts_pages_url"; 
  $wpdb->insert($table_name , array('post_id' => get_the_ID(), 'url' => get_permalink())); 

I would be very grateful if anyone had any suggestions on how I can access the permalink via a database call.

Many thanks

  • Had you considered implementing this via Ajax call to your WP installation instead? Permalink are not stored in database precisely because it is troublesome approach. :)
    – Rarst
    Commented Aug 26, 2012 at 13:01

1 Answer 1


Instead of getting stuff from the database, access the site via its feed.

http://example.com/?p=POST-ID&feed=rss2 will give you information about the post, including the permalink (in the <link> tag).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.