Questions tagged [optimization]

The tag has no usage guidance.

0
votes
1answer
24 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=...
0
votes
1answer
527 views

batch UPDATE autoload value in wp_options table

After running the following query SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'; I've found I got 1587 autoloading options values, mostly belonging to custom fields values; ...
-1
votes
1answer
16 views

Any1 knows how to make crons job for following action

how to make crons job for optimizing wordpress database how to make crons job for emptying wordpress logs in database I dont need plugin
4
votes
3answers
4k views

Optimize Multiple Taxonomy Term MySQL Query?

(Moderator's note: Title was originally: "query/database optimisation") I'm written a function for a custom "filter" search panel that allows users to select terms from up to four custom taxonomies. ...
0
votes
1answer
707 views

Database Queries Optimization with new WP_Query

I’m building (mostly with a self-teaching purpose) a simple plugin to query posts from another blog on a MS network via a shortcode (like [network-posts blogs=”8" layout=”grid” columns=”3"]), but I’m ...
0
votes
0answers
22 views

Webpack 4: combine core and plugins in unique build/admin.js?

I'm going through @wordpress/scripts but it's not clear to me how to emit a unique 'build/output.js' which would combine / merge all the assets (admin and plugins) through webpack 4. Let me explain. ...
0
votes
0answers
19 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 ...
0
votes
1answer
29 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 ...
2
votes
2answers
1k views

Minimal WordPress load for only `get_option` to work (because ajax…)

In a plugin, I use ajax to get_option() which takes much longer than it has to because entire wp gets loaded. How do I set things up so that it (my ajax) loads only what is needed? (get_option())
1
vote
1answer
1k views

Cleanup: best way to remove WooCommerce comments from the wp_comments table

I am optimizing the database of my site that is using WooCommerce. When I came across the wp_comments table, I found it close to 100 MB in total. It's all filled with WooCommerce order statuses from ...
0
votes
0answers
36 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 ...
0
votes
0answers
15 views

Uncached* Page Speed

I have a woocommerce based website. I'm using WP-ROCKET for caching and i happy with it for cached website pageload is 1second but uncached webpages like search or a new page this pageloads takes ...
0
votes
0answers
6 views

Printing extra scripts before src scripts to optimize minification and page speed

In WordPress a plugin may add extra data to be printed before or after a script when enqueueing a script. Quite a few plugins that we have enabled do this to define for example an ajax URL etc and it ...
1
vote
1answer
512 views

wordpress with 1.5 million posts

I wanted to transform my dictionaries into a WordPress website that has different dictionaries for different views. As you can imagine by now, the posts will mostly have just 2 words and a short ...
0
votes
0answers
16 views

How to optimize backend? Remove unneeded queries on All posts page primary

How to disable tags, categories, authors and date in All posts page? Any post type. In Screen options I have removed everything (author, categories, tags, comments, date) but in reality this doesn't ...
3
votes
1answer
219 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 ...
0
votes
0answers
16 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 ...
1
vote
0answers
68 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 ...
1
vote
0answers
43 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 ...
0
votes
1answer
3k views

Avoid landing page redirects issue in wordpress multisite

Recently I configured my website for https and redirected http to https but now in google page speed, I am getting issue of Too many redirects! Can be checked at: https://developers.google.com/speed/...
62
votes
8answers
5k views

Refactoring Wordpress to improve memory performance [closed]

I had a close look at Wordpress memory consumption. On my site, it seems that for each page hit 20MB of RAM gets allocated, just to prepare comfy environment for all the plugins to run in. I plotted ...
0
votes
0answers
41 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 ...
0
votes
1answer
30 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 ...
0
votes
2answers
113 views

Is my host the problem?

I've been working on my WordPress Site for quite some time now, and it's about ready to be deployed. One major issue, though - it's VERY SLOW! At first I thought that the 20 second load time could be ...
0
votes
1answer
93 views

Need to optimize wordpress websites on google pageinsight

I am trying to optimize my websites on pagespeed insight. And, for this I have tried lots of speed optimization wordpress's plugins and all have very good ratings by the users. But not even single ...
0
votes
1answer
327 views

How to optimize wp_option table?

My Wordpress website is often going down with the error message "error establishing a database connection" and when I contacted my hosting server, they replied that the query takes a long time(more ...
0
votes
0answers
31 views

Is there any way to get all custom posts and all custom terms with it's meta in few queries?

I'm developing a website with a record for me query count. It has 720 Query for the main page. I want to reduce it. The main page structure is like this: ~10 Custom Taxonomy Term Each Term has a ...
0
votes
0answers
39 views

Can lots of tags affect performance?

I'm working on a plugin that will auto-tag my posts (it's for a very specific, single project only). It will apply 6 tags based on the content of the post. Forward thinking, I wonder if the number of ...
2
votes
3answers
130 views

Defer Code in Widgets - Page Speed

How to UP Page Speed With Widget Defer? Is there a way to defer a widget in the footer? I have an external API in a footer widget which is slowing down my page. It is not needed until the page is ...
6
votes
1answer
2k views

Separate Database Tables For Different Post Types

one big problem with wordpress is that everything on it is a post(a record in wp-posts table)! images, posts, pages, products(for example in woocommerce), portfolios, Post Revisions... Almost ...
5
votes
2answers
51 views

What's the case against transient-ing almost everything that's mostly static?

Assume I have a menu that's simply static, for most sites, or rather, let's use my example, a blogging site, it almost never, never changes. Why not hook it to a transient that never expires unless ...
0
votes
1answer
24 views

How to find and remove unnecessary theme scripts? [closed]

When I load my website, I see many java scripts and css loading and slowing my website. Many of them I know I'm not using, like fonts, extra theme css from a template that I'm not using, icons and so ...
0
votes
2answers
101 views

Optimized PHP & Wordpress settings for speed/performance?

I have a big site with several plugins that take up memory, a lot of requests to the server, etc. I've maxxed out my hosting to help account for this, but are there optimum PHP and Wordpress settings ...
1
vote
1answer
317 views

Will Gutenberg Have a Negative Impact on Page Speed?

When WordPress includes Gutenberg by default, will WordPress sites suffer from slower page loading times? While it’s easy to test on a clean install, other factors, such as themes and plugins can ...
0
votes
1answer
4k views

How to set a Cookie-Free Domain with WordPress?

I recently set up a WordPress site here. I added these two lines in wp-config.php: define("COOKIE_DOMAIN", "www.artisanplombier-pascher.com"); define("WP_CONTENT_URL", "https://static....
-5
votes
0answers
41 views

What are some ways to speed up a WordPress site that most people don't know? [closed]

I am looking for ways to speed up my site, https://whatifhq.com I know this isn't the best place to post this, but I could not find anything else on the web other than "get a better server", "reduce ...
5
votes
3answers
379 views

register_post_status - show_in_admin_all_list & show_in_admin_status_list does not affect query

In the register_post_status, I've already disabled show_in_admin_all_list & show_in_admin_status_list for my custom status my_hidden_status However, from the query log the post_status ...
8
votes
2answers
5k views

How to prevent execution of default query, while preserving ability to use WP_Query in template?

PROBLEM: I'am trying to prevent execution of default WordPress query for custom category template. I have found a possible solution, but looks like it preventing execution of all post queries: ...
0
votes
1answer
736 views

Optimize WP Meta Query for large amount of post meta?

I have a large WP site with about 2k posts and 150k postmeta. When browsing to a large category, the archive loads very slow due to the WP query that is seeking for featured posts, to show them first. ...
0
votes
2answers
3k views

better wordpress minify problem

i am using better wordpress minify plugin but it breaks site due to one of css file http://www.mydomain.net/?mcsf_action=main_css&ver=3.1.1 i would like to add it into exception list so ...
0
votes
0answers
39 views

Why are the latest visits to my website originating from my own website?

To start with, I don't know anything about coding and stuff. I am here to seek help from experts hoping they can help me resolve the issue. I have a website/blog that runs on WordPress. I have a VPS ...
1
vote
0answers
132 views

Query posts without meta preload

I'm optimizing high traffic website. Trying to solve following issue: Site's home page is extremely slow and top showing 100% CPU because of Mysql. After some investigation with Query Monitor plugin, ...
19
votes
3answers
13k views

How to Optimize WP site for millions of posts

I'm working on a website for a company that will very likely be creating millions of posts via a custom post type. They're prayers, so basically the user on the front end just submits a short phrase ...
0
votes
1answer
210 views

Queries take 120+ seconds on my large Wordpress site

i have a couple of Wordpress website running on a VPS, each one of them has 1M+ posts. When adding new posts queries just hangs for a long time until the website crashes. I use XML-RPC to post to my ...
-1
votes
1answer
55 views

How to make wordpress backend mobile optimized.?

I have a membership website where my users can create their own page. Most of my users are from mobiles (they do not have laptops). When I open my website in android chrome browser, the WordPress ...
8
votes
4answers
508 views

Set Alias for meta_query arguments in get_posts()

Is there a way to set an alias on the meta_query arguments when running a get_posts()? One of my queries is performing poorly. To optimize I just need to be able to reuse the same joined table ...
0
votes
0answers
18 views

How can I stop widgets from re-executing every time I access the logged-in homepage?

I have a few widgets and they're being built-up every time someone accesses their logged-in homepage. I assume this is so that everything works nicely. Unfortunately, this is a tremendous ...
0
votes
0answers
52 views

Above the fold plugin error “The Proxy Cache directory contains n cache entries.”

I've just starting using this plugin with a site that I did not code or configure. I'm getting this error: "The Proxy Cache directory contains n cache entries. This may indicate that auto-capture ...
0
votes
0answers
195 views

Serve resources from a consistent URL GT Metrix

I am optimizing WordPress website speed and i have fixed all other issues mentioned by GT metrix (Website to test website speed) but could not fix Serve resources from a consistent URL. I know there ...
0
votes
2answers
859 views

How to properly insert a stylesheet in wp_head

I am generating critical CSS for every page and category. At the moment I am inserting the stylesheet through functions.php like this simply using echo. function criticalCSS_wp_head() { if (...