WordPress plugins for database queries

I don’t know of a plugin that allows you to do this out of the box, but as you are (/seem to be) comfortable with database manipulation, I’ve outlined below how you can achieve what you want using custom coding. You can run custom queries using the wpdb-class. There are a few posts on WPSE/SO … Read more

Are these WordPress tables safe to add indexes to?

These tables aren’t indexed These tables are indexed For example, the post meta table has these indexes: https://codex.wordpress.org/Database_Description#Indexes_5 You’re more likely to cause issues or reduce performance through bad indexing by adding new indexes. WP already specifies indexes for tables “dbmain” “wp_mf_post_meta” “post_id” “Not indexed” “dbmain” “wp_mf_custom_fields” “custom_group_id” “Not indexed” Those are not WordPress tables, … Read more

WordPress(wpdb class) and mysql stored procedures

wpdb detects the type of query and returns the result if it starts with select, else the affected rows. Since yours starts by call, it’s probably mistaking it for an insert, update, delete, etc. statement. Try this (might trick wpdb into thinking it’s a select statement: /* select */ call …; Or this (not sure … Read more

Problem with admin login after deployment

I suspect either the culprit is one of the plugins or the theme you are using. so, try: -deactivating ALL plugins temporarily to narrow down the problem. If the problem goes away, activate them individually (one-by-one) to find the problematic plugin. If you don’t have access to your admin area, try deactivating plugins manually via … Read more

SQL Query in WordPress – Getting Impossible WHERE error

Look at your conditions: WHERE ( ( (meta_key=’user_school_subjects’ AND meta_value LIKE ‘%history%’) OR (meta_key=’user_professional_courses’ AND meta_value LIKE ‘%history%’) OR (meta_key=’user_language_tutoring’ AND meta_value LIKE ‘%history%’) OR (meta_key=’user_music_tutoring’ AND meta_value LIKE ‘%history%’) ) AND (meta_key=’user_gender’ AND meta_value=”male”)) There is no way that you can have a meta key matching one of these– user_school_subjects, user_professional_courses, user_language_tutoring, user_music_tutoring … … Read more

Which is better and faster ? WordPress Queries or SQL Query

Queries ofcourse. It’s faster… But in this case just please delete you wp site and start with something faster… here is my superfast framework for you… <?php /*Your bunny wrote */ I did tests, 0.0000001 runtime vs WP usually 0.7-2.8 Sarcasm off P/S/ This question have no sence since using direct queries and output of … Read more

Defining the same price to all WooCommerce Products

Looks like you are not familiar with WordPress Bulk Edit. Change the Screen Options to show all the products you have (if there are too many this can be slow, and is better to do it following some 100/200 product per page). Select all the products, select Edit in the Bulk Edit dropdown and Apply. … Read more

Copyright: Get first and last date of post type

There was an issue with the code originally posted by kaiser in that it queried for year, month and day distinctly resulting in values representing “the largest month for any date” or the “smallest day for any date” rather than values representing the MAX and MIN dates globally. I altered that original code to query … Read more