Title: Post content pulled from non-wordpress database
Last modified: March 8, 2023

---

# Post content pulled from non-wordpress database

 *  [konkhra](https://wordpress.org/support/users/unix082/)
 * (@unix082)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/post-content-pulled-from-non-wordpress-database/)
 * Hi all!
 * I am interested to know if something like this is feasible in WordPress.
 * I would like to create posts automatically with information stored in non-wordpress
   database. The database has a table called Library which is like this:
 * book_title | author | book_description | publisher
 * I am not interested in doing it through any type of eCommerce plugin. I want 
   to have let’s say 20 books per post, pulled from the database, all being done
   programmatically, not manually. Is this going to be achieved somehow?
 * Thanks!

Viewing 1 replies (of 1 total)

 *  [pichichi](https://wordpress.org/support/users/pichichi/)
 * (@pichichi)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/post-content-pulled-from-non-wordpress-database/#post-16542158)
 * Yes it is possible, WordPress has built in functionality to interact with non
   WordPress database using its wpdb class. You can read more here: [https://developer.wordpress.org/reference/classes/wpdb/](https://developer.wordpress.org/reference/classes/wpdb/)
 * For example, create a new class then run your query:
 *     ```wp-block-code
       $librarydb = new wpdb( 'user', 'password', 'database', 'hostname' );
   
       $librarydb ->get_results("SELECT yourQueryGoesHere"); 
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Post content pulled from non-wordpress database’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 1 reply
 * 2 participants
 * Last reply from: [pichichi](https://wordpress.org/support/users/pichichi/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/post-content-pulled-from-non-wordpress-database/#post-16542158)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
