admin管理员组文章数量:1290978
How can I "update" a page in WordPress using MySQL? I.e., effectively click the "update" button in the page editor using MySQL? But not make any changes to the page?
What I'm doing: I'm making some bulk changes in wp_postmeta using a MySQL query in PHPMyAdmin, i.e. Woocommerce product data. I've discovered that each page needs to be manually "Updated" in the page editor for the product data to appear correctly on the front end. Once I make the changes in wp_postmeta, and then wp_update_post resave each page, the data appears correctly.
How can I resave or "Update" a number of pages, by each post_id, via MySQL so I don't ave to manually save each page? Would I use wp_update_post
? /
I don't need to use Ajax; this concerns ~100 pages and the server is fast, so an SQL query won't timeout.
How can I "update" a page in WordPress using MySQL? I.e., effectively click the "update" button in the page editor using MySQL? But not make any changes to the page?
What I'm doing: I'm making some bulk changes in wp_postmeta using a MySQL query in PHPMyAdmin, i.e. Woocommerce product data. I've discovered that each page needs to be manually "Updated" in the page editor for the product data to appear correctly on the front end. Once I make the changes in wp_postmeta, and then wp_update_post resave each page, the data appears correctly.
How can I resave or "Update" a number of pages, by each post_id, via MySQL so I don't ave to manually save each page? Would I use wp_update_post
? https://developer.wordpress/reference/functions/wp_update_post/
I don't need to use Ajax; this concerns ~100 pages and the server is fast, so an SQL query won't timeout.
Share Improve this question asked Jun 16, 2021 at 17:10 BlueDogRanchBlueDogRanch 1705 silver badges25 bronze badges1 Answer
Reset to default 0wp_update_post()
is a PHP function, and you can’t trigger a page update with MySQL. You need to at least use PHP, but it’s possible that some plugins actually require manually pressing update.
For WordPress and WooCommerce content your best bet would be to use the REST API or WP CLI from the command line.
本文标签: Is it possible to quotUpdatequot pages via SQL
版权声明:本文标题:Is it possible to "Update" pages via SQL? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741500387a2382026.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论