1

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 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.