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?
- How to test wp_cron?
- Running WP Cron on multisite the right way
- wpdb->insert: do I need to prepare against SQL injection?
- WP Cron Doesn’t Execute When Time Elapses
- How to parse row results from $wpdb -> get_results
- Why $wpdb->show_errors() and print_error() is showing an output even if the query output is correct?
- what is the way to see the currently executing query in wordpress?
- Fetch array with $wpdb
- How do I check for a duplicate record before inserting using wpdb
- Do WordPress cron jobs slow down page loading?
- WordPress 4.8.1 uses mysql_connect which doesn’t work with PHP 7
- How to use $wpdb to delete in a custom table
- Uncaught Error: Call to undefined function wp_generate_attachment_metadata() @ wp-cron
- $wpdb->insert not working in any way
- WPDB prepare – like % – placeholders?
- WordPress cron isn’t scheduled on amazon web services
- Running WordPress on the Command Line – Turn off Delayed Output?
- Schedule WordPress Auto-Updates to only run during business hours
- How is WP Cron Locking implemented?
- $wpdb->update multiple rows, like IN in normal SQL
- Matching database content types to PHP types
- Does $wpdb->prepare not create a prepared statement that I can execute multiple times?
- get_results on large datasets
- $wpdb->insert() and Values for Datetime Columns?
- $wpdb->last_error doesn’t show the query on error
- Better handling of WP-CRON server load abuse
- When does next Cron Job run (time from now)?
- Get frequency of scheduled event
- Running WP Cron on specific local time
- Avoiding “Usage of a direct database call is discouraged”
- Need to execute a cron job
- dbDelta does not create Table, but returns success
- run a cron task without obstructing page load?
- Theoretical Multi-Server WordPress Setup with Shared Users
- crontab wp-cron.php on multisite path-based network: one for each path? Or just one for the root?
- Recurring scheduled task help
- wpdb->insert not working
- What happens when wp_cron is deactivated in WordPress?
- Running wp-cron from CLI
- How to make wp cron job not fire immediately?
- How Do I Make WordPress Run an Event Every Day?
- get_posts inside cron
- Hourly WP schedule, do I need at least 1 visitor hourly?
- Initialize WordPress environment to use in a real cron script
- Saving custom form data into database
- Why?: hundreds of empty files named wp-cron.php?doing_wp_cron.
- Can’t access wp_filesystem in cron function
- passing variables as parameters to stored procedures via wpdb from php-script
- WP CRON runs only the first time
- Multiple wp_schedule_event cron jobs in plugin cause multi-execution
- WP Cron emails not working
- Trigger a cron every 24h GMT -8
- Get data from database table by post_id to get data from second database table
- wp-content/db.php : where is this file?
- WordPress Cron Schedule the if and else statement
- Schedule event every second thursday of the month
- Quotes in table name
- Delete/replace img tags in post content for auto published posts [closed]
- $wpdb sql help. Select post id and post meta value based on 2 other post_meta values
- $wpdb->get_results() returns good result only in first foreach iteration
- $wpdb->insert – inserting multiple rows
- Automated mark posts as featured every day
- Auto Delete Users (auto_delete_users)
- Speed optimization of $wpdb->get_results
- How do I create a single.php for a specific category?
- $wpdb prepared with search term
- WPDB->insert with special characters
- What does wp_update_post() do that the $wpdb class does not?
- How Can I Use $wpdb in PayPal IPN file?
- $wpdb is get_results escaped
- Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?
- WordPress cron running twice
- Scheduled Posts and wp-cron – Why don’t scheduled posts publish if too old?
- wp_schedule_single_event function not working
- How ( and mostly at what time ) can i prevent the alternate cron from running?
- $wpdb->query() multiple query support
- wpdb-> not adding prefix to custom table
- Is there a (better) way to access $wpdb results?
- Using $wpdb generates DB error
- WordPress insert NOW() in TIMESTAMP column returns all zeros
- How do i schedule cron in wordpress for each second?
- How do you use prepare when asking for a list of id’s
- Check if event was scheduled – schedule event only once
- Set media metadata (i.e. “dimensions” field) on SVG file after extracting it with a filter
- $wpdb prepare issue with mysql DATE_FORMAT
- How-To: wpdb Insert Record With Date
- $wpdb->prepare not working with update table prefix
- How to use prepare to query with variables
- Use $wpdb in wordpress theme files
- How to pass NULL in where array for $wpdb->update
- how to execute different sql query in non-sanitized $wpdb->get_results function
- $wpdb not returning data