• H, i’m trying to create bulk posts and add feature images thru mysql. I create registers on wp_posts and wp_postmeta (even with metadata) for all images related to each post, but without success. What am I missing?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • @rocfreitas To make sure I understand correctly, you’re trying to bulk-import posts and featured images through MySQL, is that correct? If so, I’d highly recommend not doing this through MySQL, but rather creating a script (WP-CLI could be a great resource) and using the standard WordPress functions to insert posts and featured images.

    The issue is the WordPress functions wp_insert_post() and set_post_thumbnail() do more than just inserting into the database such as setting/clearing caches and properly settings IDs. If you bulk-import strictly using MySQL, you will likely have some unintentional side effects.

    Thread Starter rocfreitas

    (@rocfreitas)

    @bengreeley I never use WP-CLI. But I will look into the documentation. Any advice?

    My only advice is to make sure WP-CLI is something you can use on your hosting environment before digging into it. Some hosting companies don’t provide SSH access or ways to run WP-CLI commands so you may want to look into their support first.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Trying to add featured images by mysql’ is closed to new replies.