page load is not affected […] and the //METADATA is echoed/displayed immediately?
With your current setup, that is not possible. In order to display immediately, you need the data. To get the data, you need to wait.
Possible solutions are:
-
Fetch the data before (e.g. via Cron) and populate the DB with the info. -> No need to fetch it live, but you might not know, which
id
s to get and which not to. -
Fetch the data asynchronous (e.g. via calling a REST endpoint in the template). -> Page will load fast, but parts are missing and rendered later. No need to pre-fetch the data though.
Related Posts:
- Change post status based on meta value
- using $wpdb to insert a form into a post
- Programmatically Creating Page using $wpdb and getting 404 error
- How to protect a script execution on WordPress?
- $wpdb->insert() doesnt work anymore
- duplicate entries in database while using save_post or wp_insert_post
- adding a log row log table, when the draft post publish
- $wpdb->get_row() only returns a single row?
- Running WP Cron on multisite the right way
- what is the way to see the currently executing query in wordpress?
- WordPress cron isn’t scheduled on amazon web services
- Schedule WordPress Auto-Updates to only run during business hours
- $wpdb->last_error doesn’t show the query on error
- Delete/replace img tags in post content for auto published posts [closed]
- Automated mark posts as featured every day
- What does wp_update_post() do that the $wpdb class does not?
- WordPress cron running twice
- How ( and mostly at what time ) can i prevent the alternate cron from running?
- wpdb-> not adding prefix to custom table
- Get random row from custom table
- store custom WP table names in a global variable
- How to save html and text in the database?
- XOR functionality for meta_query
- Why is wp-cron only executing on page visit?
- How can I migrate mysql_fetch_array to $wbpdb?
- Foreach loop using $wpdb not results from rows
- Cron schedule not updating after run
- Return XML of Post Metadata
- export a csv file from the database with a cronjob
- wp_schedule_single_event not working: cron job is triggered but nothing gets executed
- WP All Import manual Cron
- wp-cron behaviour when there are multiple queued tasks
- Set post to unpublished after one week depending on condition
- Problem in inserting row to custom database table
- WP cron doesn’t pass through my arguments
- sanitize_text_field and apostrophe problem
- $wpdb->prepare with ON DUPLICATE KEY UPDATE
- Code only works every other time its run
- wpdb updating record in wordpress with json adds extra array elements
- How to display a specific category using a custom Query?
- Can’t pass variable in wordpress wpdb->get_results
- How to force ‘cron_schedules’ every minute instead 1 hour?
- AWS Bitnami WordPress – SELECT command denied to user
- WPDB Placeholders and second argument for prepared statements
- PHP Fatal Error – $wpdb a non-object?
- How to use wp cron job to run a function
- How do I count columns on a custom WPDB query?
- Trouble inserting string containing quotations marks with wpdb in save_post hook
- A unique wp_schedule_single_event() for each post?
- get_results query with accent
- Is querying wpdb directly and skipping actions provided by WP’s core “wp_update_post” a good idea?
- wpdb query not working
- Where can I see MySQL hostname and port for wp-config.php
- WordPress wpdb->insert returns int(0) => doesn’t insert anything, no errors!
- Using “->” in a page to exceute $wpdb query gives error
- Display a random tag but using cron to control frequency of change
- $wpdb->get_results not returning an array
- Insert two row in wordpress database
- Get all sticky posts from one user through user ID
- WPDB Query Question with Category Only
- wpdb result arrray inside an array
- $wpdb->num_rows doesn’t work
- How can I change my meta_query to SQL wpdb query?
- What causes wp_schedule_single_event to fire off?
- Can/should we delete wordpress cron jobs with no action?
- How capturate wpdb exceptions?
- Activate Plugin Automatically After Set Time
- Limit left join
- Flush rewrite rules with scheduled event (cron)
- Get records from Formidable Table using $wpdb->get_col
- Prepare WPDB with meta key and meta value
- Cron not sending wp-mail()
- WP_CRON issue with UTC and local time
- Plugin with functions inside a class & how to trigger WP CRON
- wont add form details to database or send me mail
- WordPress crob job performance
- Call to a member function insert()
- WordPress: Cron locking and Queue
- Missing argument 2 for wpdb::prepare() [duplicate]
- wpdb->update update the entire table instead of one row
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- WPDP related functions look to work but they don’t
- Huge cron option_value into wp_options table
- Save customizer default values to DB on theme activation
- Plugin with connection to database – Single function
- Alter the main search query to search posts by coauthor user name
- Protect custom form from SQL injection
- why nl2br() is adding an extra ?
- How to add more custom fields in user meta table simultaneously
- wpdb->update error
- get unserialized array without using get_option()
- Create Table Failed Column Date DateType
- Using $wpdb to update current post
- DBDelta: “table doesn’t exist” for a table that was just created
- query using wpdb in wordpress gets me no result
- How to know if WP cron is currently running my hook?
- query_vars doesn’t return query string (trying to get data from $wpdb)
- Custom cronjob not executing at all, but manually
- ‘wp_site_health_scheduled_check’ Causes Failure Of Other Scripts
- $wpdb->prepare UPDATE process not work in functions.php