Unable to modify(update) posts – Page not found

For couple of days I am experiencing issues with modifying some of my posts. When I try to modify the content of post, I get 404 error, redirecting me that page is not found. Doing Google research, with all basic tests, clear cache, browser, enable/disable plugins, changing permalinks, etc, I’ve found this on WP forum, … Read more

wp_update_post does not update post_name

I have a post with id=1, post_title=”Some post title” and slug(post_name)=’some-post-title. I want to update its title and slug. $update_args = array( ‘ID’ => ‘1’, ‘post_title’ => ‘Test purpose’, ‘post_name’ => ‘new-slug’ ); $result = wp_update_post($update_args); After that post title is updated but slug stays the same(some-post-title) but not new-slug. I cannot understand how can … Read more

How can I stop wp_update_post messing up HTML example code?

I’m showing little pieces of example HTML/PHP code on the frontend (with syntax highlighting). The entries are displayed as FAQ custom posts, and have a plugin (CMS Tree page) to alter the menu order, at which these are displayed. Whenever I change the order, it calls a wp_update_post, updating ID, menu_order, post_parent, post_type. For debug, … Read more

Updating a post without escaping ampersands?

I’ve found that wp_update_post() escapes all ampersands provided in the post’s post_content. I’m trying to update a post without converting ampersands to &. (I need to add plaintext URLs (not links) to the post_content field of posts). So, I’m trying to find a way to use wp_update_post() with escaping disabled, or perhaps another function in … Read more

Scheduling posts to update once per day with wp_cron

I have a function that hooks into save_post that changes the value of a custom taxonomy term based on today’s date. That’s working fine. When I update a post, the taxonomy term is updated correctly. But I want this update to happen automatically, once a day, without having to manually update the posts myself. I … Read more