Skip to main content

Questions tagged [optimization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

How to cache results of of get_available_post_statuses() function as it is causing a slow query on a website with over 1 million posts?

The function get_available_post_statuses() is being called by WP_Posts_List_Table->prepare_items(), which is calculating posts on each load of admin. Since this is a core wordpress function and I ...
dc09's user avatar
  • 195
0 votes
0 answers
15 views

Child sites are slowly loading images from main site (main site is super fast)

We have an un-solved (and very large) speed issue with this site: https://micronordic.com/dk/ and all other 26 child sites on the http://micronordic.com/ domain. The child sites are loading the images ...
Jens Kirk's user avatar
  • 111
0 votes
0 answers
34 views

I need to optimize a website and I want it to import the js libraries only when I need themL

My problem is that I need to optimize a website, one of the ways is by removing that JS that is not used in the page, the website is quite large, I have managed to remove that JS that is not used but ...
Miguel Angel Salas8's user avatar
0 votes
0 answers
20 views

Can I Load posts from an External database if the post is not found on Main Wordpress Database

I have a WordPress Site on a dedicated server (on a considerably larger Capacity Server - 128GB RAM/64 Processor - 2TB NVme). THE PROBLEM We have a considerably large amount of data inside the ...
Rhema's user avatar
  • 1
0 votes
2 answers
404 views

How to reduce uncached page generation time?

On uncached pages, I have been able to bring down database query timinings to less than 0.2 seconds with sql tuning. However, the page generation time is still around 2 seconds as seen below via query ...
dc09's user avatar
  • 195
0 votes
1 answer
50 views

WordPress - Optimize the Meta Query for 3 meta keys at a time

Records in post_meta as follow: post_id key value 1 price 10 1 price_to 5000 2 price_type 'POA' 3 price 12000 3 price_to 17000 4 price 1200 4 price_to 8000 5 price_type 'POA' Code Snippet &...
Mahesh Thorat's user avatar
0 votes
0 answers
35 views

Optimize blog that serves hundred of images and videos

We have a website that contains 20,000+ media. It serves images and videos per post(500 post as of now). Opening posts takes a very long time to open because it contains images(500+) and videos(50+). ...
user14772091's user avatar
0 votes
0 answers
204 views

Serve images as webp if browser support

I want to serve webp images if the browser support as Google Page Speed is asking me to serve images in next-gen format , I am looking for a solution without using any plugin : I have found some code ...
Ahmed C's user avatar
1 vote
0 answers
40 views

Enable webp support Nginx+Apache reverse proxy with moss.sh [closed]

I am scratching my head from last few hours but unable to get reliable source to solve below problem. Actually, I am trying to setup WP Smush (or any webp plugin) with webp support on Nginx + apache ...
Aman Singh's user avatar
0 votes
1 answer
101 views

How to add some basic inline CSS using existing plugin or theme?

Sometimes you have a theme or a very lightweight WordPress plugin (like a single PHP file) and you want to add some CSS easily without having to load more files or folders, etc. How can you add some ...
Jesse Nickles's user avatar
1 vote
1 answer
2k views

Best way to search and replace within serialized database strings?

The frustration of serialized data in WordPress has been around for years... trying to search and replace strings in your database using tools like WP-CLI, MySQL queries, or even plugins like Better ...
Jesse Nickles's user avatar
0 votes
0 answers
124 views

Optimising WP_Query with ACF Fields

I am wondering if it's still possible to optimise the WP_Query or also if there's another way of doing it. I have the post type and a custom post type called case-study which gets displayed on the ...
Erick T's user avatar
0 votes
1 answer
19 views

My authors need to be able to preview their upload images and manipulate and scale

I am using a form and that form allows for IMAGE UPLOAD. After submission the form redirects and then they can see the reviewed post - however if the image which they uploaded blindly does not look ...
Nenno007's user avatar
0 votes
1 answer
337 views

Obfuscate links (for SEO purpose) [closed]

Link obfuscation is a more and more common topic in order to improve SEO by masking the non-important links to provide more weight to others. I'm looking for an efficient way to obfuscate links in ...
rAthus's user avatar
  • 171
0 votes
1 answer
23 views

image resizing on post content without css and html tags

Background: I am using WordPress posts for Newsletter. I am importing the posts through an api and use them in a Newsletter tool to send them out. I am downsizing the featured image before feeding to ...
Janith Chinthana's user avatar
-1 votes
1 answer
108 views

Viewing a WordPress website in landscape [closed]

I have a client that wants to landscape support for his website. I have never needed to optimize a website for landscape view nor did it ever cross my mind. If possible how do I do it on WordPress?
Martin De Jonge's user avatar
1 vote
1 answer
431 views

WP Optimization: Removing Orphaned wp_options (especially the autoload ones)

Is there no mechanism which purges old options from the DB? I tried a few plugins in the past and I found out that there are a few pretty long option strings which are set to autoload but IMHO not ...
tim's user avatar
  • 164
0 votes
1 answer
38 views

How to deal with too many $_POST variable conditions from ajax request at backend? [closed]

At work, we write a PHP application. I'm only a junior, but I'm dissatisfied with the problem of processing AJAX calls. Each of AJAX request is directed to the single appdata.php script. At appdata....
Sahasrar's user avatar
0 votes
0 answers
81 views

How to optimize posts query in wordpress

basically, I'm trying to optimize this query we have more than 100K blogs and I need to make it faster now it takes Load time (07.46 s). <?php if ( get_query_var( 'paged' ) ) { $...
Mohamed Mazen's user avatar
1 vote
0 answers
6k views

Deferring Script wp-i18n causes a console error 'wp is not defined' - Gravityforms

I am deferring JS scripts in order to optimize page load times and SEO. My code to defer scripts is something like: add_filter( 'script_loader_tag', // Filters the HTML script tag of an enqueued ...
Meyer Auslander - Tst's user avatar
0 votes
0 answers
566 views

How to deliver webp format of images to WP REST API

I use WP Offload Media Lite plugin to offload upload image to S3. I use raw S3 URL (not CDN) and choose remove file in server option. Then I use EWWW Image Optimizer plugin to convert image on S3 to ....
Tien Nguyen Nhut's user avatar
0 votes
1 answer
349 views

Is there a way to ensure local fonts load from CDN when CDN is enabled?

I've set up a WordPress site with one local font. It is stored in the a fonts folder in the child theme. It is loaded with the following in the child theme style.css @font-face { font-family: '...
omega33's user avatar
  • 354
1 vote
1 answer
127 views

I'm designing a plugin to create database indexes. Suggestions?

I'm starting a (totally open-source) little project to create a WordPress plugin that will add appropriate indexes to WP's MySQL tables to improve performance. (Some wp tables, notably wp_postmeta and ...
O. Jones's user avatar
  • 471
1 vote
1 answer
70 views

Improve wp query perfomance on large db

I have 100000 records in my database and so many meta query performed on it so it takes lot of time to perform the operation, what is the way to speed up this? It takes 20 to 25s to load this query. ...
user2532600's user avatar
0 votes
0 answers
406 views

How to do chunked JS files in WordPress?

Webpack outputs chunks of JS files in order to parallelize downloads over HTTP/2 but unfortunately WP's wp_enqueue_script requires that only one file be loaded to represent a script, forcing us to ...
Daniel Simmons's user avatar
2 votes
1 answer
253 views

Continue execution after WP REST API response

I am trying to extend the Wordpress REST API with an endpoint that takes Zoom webhooks. Zoom requires a response within 3 seconds or will blacklist your endpoint address, but the processing that I ...
Ari Cooper-Davis's user avatar
1 vote
1 answer
235 views

Improve performance by removing unnecessary database queries

I've just found out that main page of custom theme im developing does 150 db queries on every load (what takes even 2.5 seconds). Many of them come from functions.php, and are caused by for example ...
user avatar
2 votes
1 answer
659 views

Wordpress Query is taking more then 20 second and stuck on creating index

Hi I need help with below query this query takes around 20 second and when more then one is executed then server CPU usage hits 100% and server stop responding. here is the query from process list. ...
Danial Akhter's user avatar
0 votes
2 answers
1k views

Will memcached improve performance with WP Super Cache already running?

I'm working on a WordPress site that is expected to host up to 1000 concurrent users, so I'm exploring ways to make it run as fast as possible. I've heard that memcached helps WordPress sites load ...
John Doe's user avatar
  • 287
0 votes
1 answer
635 views

How can i unload effect.min.js file?

I'm currently working on optimizing the speed of my WordPress site, and i successfully unloaded some unnecessary files, but there is one i can't seem to remove which is: https://domain.com/wp-...
marouane91's user avatar
0 votes
0 answers
67 views

Google Page Speed

My website is in Wordpress so I am asking question regarding Google Page Speed here. My issue is i had completed the development of home page of existing page now when i am trying to check the score ...
Bhargav Joshi's user avatar
0 votes
1 answer
394 views

Can mediaelement-and-play core JS be dequeued?

I'd like to understand what is the purpose of the WordPress core javascript file /wp-includes/js/mediaelement/mediaelement-and-player.min.js I am asking that because it weighs 136KBytes and I'd like ...
Drake's user avatar
  • 1,431
2 votes
2 answers
3k views

SQL: How to find all attachments that are not used in any posts/pages/custom_post_types

I have a wordpress installation where the posts also contain attachments that were not embedded in the content by using the media library -> add. I would like to find all attachments that are not ...
yoho's user avatar
  • 45
0 votes
0 answers
117 views

Wordpress UPDATE queries on MySQL database stuck

I have an Amazon 24XL server 96 Cores 378 GB RAM Database size 5.7G Debian GNU/Linux 9 (stretch) PHP 7.3.16 mysql Ver 15.1 Distrib 10.3.22-MariaDB I have only one WordPress site where users read ...
Naqi's user avatar
  • 1
0 votes
0 answers
769 views

How to optimize wp_delete_post() function, or why it is so slow

I have a code block to delete all the products from a store. This products have several custom fields and some images attached. The code is below: set_time_limit(0); define('WP_USE_THEMES', false); ...
Kevin Mamaqi's user avatar
0 votes
1 answer
1k views

Should I use wp_cache in my plugin to make it faster?

As a plugin developer, I strive for coding plugins that take as less server resources as possible. That's why I thought of avoiding to repeat queries to the database that are run on the same request (...
Víctor Noir's user avatar
0 votes
1 answer
39 views

What is the best way to host a site with many images without it being too slow?

I have a friend that wants me to help them with their WordPress website that has about 150 images for their gallery. Their site is quite slow even after I optimized the images using the ImageOptim app....
I Am Sir Ask Alot's user avatar
1 vote
1 answer
40 views

Page taking time in loading. Also used lazy loading but doesn't work?

There are number of logo images and many are shown under show more button. But all are getting loaded at a time. Due to page speed decreases. I have used lazy load plugin but still is taking time on ...
nss's user avatar
  • 11
0 votes
1 answer
24 views

Can the benefits of performance optimization plugins outweigh the tax of installing them on performance?

Everyone knows that having too many active plugins often results in a slow site. I ran a check on one of my sites through GT Metrix and found several issues contributing to its slowness. Among these ...
Gnumbertester's user avatar
1 vote
0 answers
16 views

How to show optimized list of posts with all their attachment images

In page-images.php template I have created this code which displays a list of posts which belong to a category and order them by meta value. So basically it is like a category page, generally nothing ...
Ivan Topić's user avatar
0 votes
1 answer
761 views

get_the_id, get_the_permalink, and get_the_title all with one DB call

we are trying to optimize a heavy traffic WP site, and am looking for a way to get the data for these three WP functions with only one query, in order to reduce queries & load on DB server: $wpid=...
Migrateq's user avatar
  • 146
0 votes
0 answers
264 views

Reusing old post IDs

When I exported my posts I noticed that some of the ID numbers were missing e.g. it started from 8 and went to say 21 and then from 24 to 30 etc. Is it possible to reuse IDs 1-7 (or any others that ...
hs1972's user avatar
  • 1
0 votes
1 answer
555 views

WordPress plugin activation, deactivation and uninstall hook not being triggered

I am developing a WordPress plugin which requires certain rules to be added to the .htaccess file of the WordPress installation upon activation of the plugin. Initially, before I switched my code to ...
Minhaz Mohamed's user avatar
0 votes
0 answers
349 views

Wordpress Query optimaization for slow query

I've WP installation with some 120K posts. One of the slow queries that frequently appear at @mysql-slow.log is below # Query_time: 1.744827 Lock_time: 0.000567 Rows_sent: 1 Rows_examined: 635732 ...
TELA's user avatar
  • 1
0 votes
0 answers
23 views

Does &$this is really disallowed to use anywhere?

I got this message from the validator of plugins from Envato: When creating a callable, never use &$this, use $this instead: I think he may be wrong with his 'never use'. Are we ...
KestutisIT's user avatar
1 vote
0 answers
644 views

What type of index should I use for postmeta?

I already added a composite index but it still took 5 seconds to finish these 2 queries. SELECT COUNT( DISTINCT( wpp.id ) ) FROM `wpdgls_posts` wpp JOIN `wpdgls_postmeta` wpm ON wpp.id = wpm.post_id ...
Driggs Alonzo's user avatar
3 votes
1 answer
1k views

Speeding Up Bulk Post Creation - wp_insert_post & update_post_meta

I am creating posts (variable products) using (wp_insert_post) function. An Example, I have 9 colors, 9 sizes. Which makes 9×9 = 81 total variations for 1 product, which is 81 times below function to ...
HOY's user avatar
  • 291
2 votes
2 answers
3k views

How to solve slow WordPress site caused by attachment_metadata

My WordPress sites starting to become slower by time, after two years they become very slow. I tried many things, such as: improved my DB, used cache plugins (WP Rocket and W3 Total Cache) which both ...
Arash Rabiee's user avatar
0 votes
0 answers
574 views

How to prevent Vimeo duplicate requests?

I've been tasked to optimize a wordpress site (big surprise...) and found that Vimeo embeds duplicates of their player api js file. I would have thought the browser would prevent this but apparently ...
LetTheWritersWrite's user avatar
0 votes
1 answer
77 views

Is querying wpdb directly and skipping actions provided by WP's core "wp_update_post" a good idea?

I need to query a lot of posts at once. A lot and performance is more than crucial here - things moving slow will net me bad reviews, a lot of them, but cutting a bit through WP's overhead could net ...
coolpasta's user avatar
  • 919