I'm writing a plugin which uses
wp_insert_post() to insert posts programatically and my permalink setting is
Of all the post inserted,
wp_posts.guid shows 2 types of output. Some post will be following
/%category%/%postname%/ and some
/?p=POST_ID. When I use
get_permalink(), I also get mixed results much like what's stored in
I wonder what causes this and how can I force all the posts to follow my permalink configuration?
At the same time, how do I force all link of
/p=POST_ID to redirect according to the permalink setting, which in this case
EDIT: I later found out that those with default permalink are actually 'draft' posts. Sorry for the confusion.