Home Forums Backend Issues (wp-admin) Database cleanup, feedback on function Reply To: Database cleanup, feedback on function

  • If you can do it with a cron task then you don’t need to worry about it timing out. You can set_time_limit(0);

    Like I said, there are some known issues with doing queries and joins or multiple inner joins from the post to the postmeta table. I’ve recently read about it but don’t recall where. There are plans to fix it, but that doesn’t solve you problem now. But what this means is that if it’s queries for searching posts by post meta, depending on how many meta_query values you’re supplying it may not help the problem.

    Also, it won’t stop the empty rows from building up in the database in the future. If this is a concern then you should create an acf/save_post action to remove empty fields when posts are published or updated in the future.

    I’d really like to know if removing the empty values helps your situation, it it does I’ll likely build a plugin for myself that does this on all ACF fields.