0
votes

I am trying to create a Wordpress page using MySQL query. Here is my query.

INSERT INTO wp_posts (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`, `post_type`, `post_mime_type`, `comment_count`) 
VALUES (1, '2010-11-29 14:05:04', '2010-11-29 08:05:04', 'cool.', 'Nice', '', 'publish', 'open', 'open', '', 'nice', '', '', '2010-11-29 14:05:04', '2010-11-29 08:05:04', '', 0, 'http://exampleurl.net/', 0, 'page', '', 0);

If I execute the above query, it creates new page. Now if I try to go the page using browser, it shows me this

Not Found
Apologies, but the page you requested could not be found.


NB: I am using custom permalink: /%category%/%postname%.

1

1 Answers

0
votes

What are you doing!? Don't use raw SQL for inserting posts, use the function wp_insert_post()!