Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access

Tag: wordpress optimization

Wordpress

WordPress: Disable Post Revisions to Reduce Database Bloat

- 13.02.26 - ErcanOPAK comment on WordPress: Disable Post Revisions to Reduce Database Bloat

WordPress saves every draft edit as revision. Posts with 100+ revisions bloat your database. Limit Revisions in wp-config.php: // Keep only last 3 revisions define(‘WP_POST_REVISIONS’, 3); // Or disable completely define(‘WP_POST_REVISIONS’, false); Add above /* That’s all, stop editing! */ line. Clean Existing Revisions: Install “WP-Optimize” plugin → Database tab → Remove all post revisions […]

Read More
Wordpress

WordPress Speed Hack: How Lazy Loading Images Cuts Page Load Time in Half

- 05.02.26 - ErcanOPAK comment on WordPress Speed Hack: How Lazy Loading Images Cuts Page Load Time in Half

WordPress sites loading slowly due to images? Native lazy loading with modern techniques dramatically improves performance. // Add to functions.php function add_lazy_loading_attributes($content) { // Only run on frontend if (is_admin() || wp_is_json_request()) { return $content; } // Use DOMDocument for reliable parsing if (class_exists(‘DOMDocument’)) { $dom = new DOMDocument(); @$dom->loadHTML(mb_convert_encoding($content, ‘HTML-ENTITIES’, ‘UTF-8’)); $images = $dom->getElementsByTagName(‘img’); […]

Read More
Wordpress

WordPress: Speed Up Admin Dashboard by Disabling Heartbeat API

- 03.02.26 - ErcanOPAK comment on WordPress: Speed Up Admin Dashboard by Disabling Heartbeat API

WordPress admin panel sluggish and using 100% CPU? The Heartbeat API polls your server every 15 seconds for autosave and notifications, eating resources. What Heartbeat Does: Every 15 seconds: – Check for new comments – Check for plugin updates – Autosave post drafts – Notify about other users editing same post – Trigger scheduled tasks […]

Read More
Wordpress

Stop WordPress Comment Spam Without Plugins Using This .htaccess Rule

- 01.02.26 | 01.02.26 - ErcanOPAK comment on Stop WordPress Comment Spam Without Plugins Using This .htaccess Rule

Getting hundreds of spam comments daily? Here’s a plugin-free solution that blocks 95% of spam bots at the server level. The Problem: Most spam bots post comments by directly hitting your wp-comments-post.php file, bypassing your website’s front-end entirely. Anti-spam plugins catch this AFTER it reaches WordPress, wasting server resources processing garbage requests. The Solution – […]

Read More
Wordpress

Why “Just Disable Plugins” Is the Wrong Performance Advice

- 30.01.26 - ErcanOPAK comment on Why “Just Disable Plugins” Is the Wrong Performance Advice

Plugins aren’t slow. Bad hooks are. What actually hurts init hooks doing heavy logic Unconditional database queries Hooks running on admin + frontend Fix Profile hooks Load logic conditionally Split admin/frontend hooks

Read More
February 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
232425262728  
« Jan    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (934)
  • How to add default value for Entity Framework migrations for DateTime and Bool (830)
  • Get the First and Last Word from a String or Sentence in SQL (822)
  • How to select distinct rows in a datatable in C# (799)
  • How to make theater mode the default for Youtube (708)
  • Add Constraint to SQL Table to ensure email contains @ (572)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (552)
  • Average of all values in a column that are not zero in SQL (517)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (473)
  • Find numbers with more than two decimal places in SQL (436)

Recent Posts

  • C#: Use init Accessor to Create Immutable Objects Without Constructor Boilerplate
  • C#: Use Index and Range Operators for Cleaner Array Slicing
  • C#: Use Null-Coalescing Assignment to Simplify Lazy Initialization
  • SQL: Use CHAR Instead of VARCHAR for Fixed-Length Columns to Save Space
  • SQL: Use CROSS APPLY Instead of Subqueries for Better Performance
  • .NET Core: Use Required Modifier to Force Property Initialization
  • .NET Core: Use Global Using Directives to Avoid Repeating Imports
  • Git: Use git restore to Unstage Files Without Losing Changes
  • Git: Use git bisect to Find Which Commit Introduced a Bug
  • AJAX: Use Fetch with Signal to Cancel Requests When User Navigates Away

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (934)
  • How to add default value for Entity Framework migrations for DateTime and Bool (830)
  • Get the First and Last Word from a String or Sentence in SQL (822)
  • How to select distinct rows in a datatable in C# (799)
  • How to make theater mode the default for Youtube (708)

Recent Posts

  • C#: Use init Accessor to Create Immutable Objects Without Constructor Boilerplate
  • C#: Use Index and Range Operators for Cleaner Array Slicing
  • C#: Use Null-Coalescing Assignment to Simplify Lazy Initialization
  • SQL: Use CHAR Instead of VARCHAR for Fixed-Length Columns to Save Space
  • SQL: Use CROSS APPLY Instead of Subqueries for Better Performance

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com