Title: Adding a page or post through a plugin
Last modified: August 19, 2016

---

# Adding a page or post through a plugin

 *  [techtwo](https://wordpress.org/support/users/techtwo/)
 * (@techtwo)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/adding-a-page-or-post-through-a-plugin/)
 * Hello everyone,
 * Im writing a plugin where i need to be able to add post and/or pages to the wp_posts
   table.
 * I now execute a query, inserting exacly the same as the default wordpress add
   query, however, all the page’s i insert via the plugin give a 404 when accessing
   them trough the front of the blog.
 * When i go to the admin panel and edit one of the posts added via the plugin (
   and save the page), it no longer gives a 404.
 * So my question is, does wordpress store information about the posts/pages in 
   another location besides the wp_posts table, or do the pages get cached and i
   need to update the cache after adding a page to the DB?
 * Thanks in advance,
    Wim

The topic ‘Adding a page or post through a plugin’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [techtwo](https://wordpress.org/support/users/techtwo/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/adding-a-page-or-post-through-a-plugin/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
