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
  • Privacy Policy

Category: Wordpress

Wordpress

Why WordPress Admin Gets Slower Even Without Traffic

- 30.01.26 - ErcanOPAK comment on Why WordPress Admin Gets Slower Even Without Traffic

Low traffic, fast server… yet wp-admin crawls. Actual culprit Autoloaded options table Plugins storing large serialized blobs in wp_options Diagnosis SELECT option_name, LENGTH(option_value) FROM wp_options WHERE autoload=’yes’ ORDER BY LENGTH(option_value) DESC; Why it matters Autoloaded options load on every request.

Read More
Wordpress

Why wp-cron Breaks Under Traffic (And How to Fix It)

- 29.01.26 - ErcanOPAK comment on Why wp-cron Breaks Under Traffic (And How to Fix It)

wp-cron.php is not real cron. Problem High traffic = cron spamLow traffic = cron never runs Correct setup Disable wp-cron Use real server cron define(‘DISABLE_WP_CRON’, true); Then schedule: */5 * * * * curl https://example.com/wp-cron.php  

Read More
Wordpress

Fix Random Logouts Caused by Cookie Domain Mismatch

- 29.01.26 | 29.01.26 - ErcanOPAK comment on Fix Random Logouts Caused by Cookie Domain Mismatch

Users get logged out randomly. No errors. Nightmare. Root cause WP_HOME, WP_SITEURL, and cookie domain mismatch (especially behind proxies or Cloudflare). Permanent fix define(‘WP_HOME’, ‘https://example.com’); define(‘WP_SITEURL’, ‘https://example.com’); define(‘COOKIE_DOMAIN’, $_SERVER[‘HTTP_HOST’]); This stabilizes sessions instantly.

Read More
Wordpress

Custom Login Error Message (Security Trick)

- 28.01.26 - ErcanOPAK comment on Custom Login Error Message (Security Trick)

add_filter(‘login_errors’, fn() => ‘Invalid credentials.’); Why it mattersPrevents username enumeration attacks.

Read More
Wordpress

Disable Emojis Without Plugins

- 28.01.26 | 28.01.26 - ErcanOPAK comment on Disable Emojis Without Plugins

remove_action(‘wp_head’, ‘print_emoji_detection_script’, 7); remove_action(‘wp_print_styles’, ‘print_emoji_styles’); Why it mattersRemoves extra JS/CSS → faster first paint.

Read More
Wordpress

Custom REST Endpoint Without a Plugin

- 27.01.26 - ErcanOPAK comment on Custom REST Endpoint Without a Plugin

add_action(‘rest_api_init’, function () { register_rest_route(‘custom/v1’, ‘/ping’, [ ‘methods’ => ‘GET’, ‘callback’ => fn() => ‘pong’ ]); }); Why it mattersLightweight APIs for headless or automation use.

Read More
Wordpress

Load Plugins Only on Needed Pages

- 27.01.26 - ErcanOPAK comment on Load Plugins Only on Needed Pages

add_filter(‘option_active_plugins’, function ($plugins) { if (!is_page(‘contact’)) { $plugins = array_diff($plugins, [‘contact-form/plugin.php’]); } return $plugins; }); Why it mattersMassive performance gain without deleting plugins.

Read More
Wordpress

Custom Post Status for Internal Workflows

- 26.01.26 | 26.01.26 - ErcanOPAK comment on Custom Post Status for Internal Workflows

Editorial chaos? Add your own status. register_post_status(‘internal-review’, [ ‘label’ => ‘Internal Review’, ‘public’ => false ]); Why it mattersCleaner workflows without extra plugins.

Read More
Wordpress

Disable Heartbeat API Selectively (Not Globally)

- 26.01.26 - ErcanOPAK comment on Disable Heartbeat API Selectively (Not Globally)

Heartbeat eats CPU on admin screens. add_action(‘init’, function () { wp_deregister_script(‘heartbeat’); }); Why it mattersAdmin stays responsive without breaking autosave where needed.

Read More
Wordpress

Why Your Site Is Slow Even With Caching Enabled

- 25.01.26 - ErcanOPAK comment on Why Your Site Is Slow Even With Caching Enabled

Autoloaded options are silently killing performance. SELECT option_name FROM wp_options WHERE autoload = ‘yes’; Why this mattersToo many autoloaded rows = memory bloat on every request.

Read More
Wordpress

Stop Installing Plugins for Simple Redirects

- 25.01.26 - ErcanOPAK comment on Stop Installing Plugins for Simple Redirects

You don’t need a plugin for redirects. # .htaccess Redirect 301 /old-page /new-page Why this mattersFewer plugins = less attack surface + faster TTFB.

Read More
Wordpress

Disable WordPress Cron to Fix Random CPU Spikes

- 24.01.26 - ErcanOPAK comment on Disable WordPress Cron to Fix Random CPU Spikes

WordPress pseudo-cron (wp-cron.php) runs on page load — not time-based. Why this is bad:High traffic = cron storm = CPU spikes. Proper fix: define(‘DISABLE_WP_CRON’, true); Then add a real cron job: */5 * * * * wget -q -O – https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1 Result:Predictable performance, lower server load, faster page responses.

Read More
Wordpress

Stop WordPress from Killing Your Site During Plugin Updates

- 24.01.26 - ErcanOPAK comment on Stop WordPress from Killing Your Site During Plugin Updates

A failed plugin update can lock WordPress into maintenance mode forever. Why it happens:WordPress creates a .maintenance file and never deletes it if PHP times out. Instant fix (no admin panel needed): /public_html/.maintenance Delete that file. Prevention (best practice): Add to wp-config.php: define(‘WP_MEMORY_LIMIT’, ‘256M’); define(‘WP_MAX_MEMORY_LIMIT’, ‘256M’); This prevents update-time PHP crashes.

Read More
Wordpress

WordPress Theme Updates Break Custom Fixes

- 23.01.26 - ErcanOPAK comment on WordPress Theme Updates Break Custom Fixes

Everything works… until update day. Why it happensEdits made directly to theme files. Why it mattersCustomizations get wiped. Vital fix Always use a child theme.

Read More
Wordpress

WordPress Pages Load Slowly Only for Logged-In Users

- 23.01.26 - ErcanOPAK comment on WordPress Pages Load Slowly Only for Logged-In Users

Guests are fast, admins suffer. Why it happensAdmin bar + disabled cache for logged-in users. Why it mattersYou think the site is slow — users don’t. Vital fix Test performance in incognito + cache enabled.

Read More
Wordpress

WordPress Database Grows Without Content Growth

- 22.01.26 - ErcanOPAK comment on WordPress Database Grows Without Content Growth

Same content, bigger DB. Why it happensPost revisions accumulate silently. Why it mattersBackups slow down, queries degrade. Smart fixLimit revisions. define(‘WP_POST_REVISIONS’, 5);  

Read More
Wordpress

WordPress Cron Jobs Run at the Worst Time

- 22.01.26 - ErcanOPAK comment on WordPress Cron Jobs Run at the Worst Time

Scheduled tasks slow down visitors. Why it happensWP-Cron runs on page load. Why it mattersTraffic spikes = slow site. Smart fixDisable WP-Cron and use real server cron.

Read More
Wordpress

WordPress Media Library Becomes Unusable Over Time

- 21.01.26 - ErcanOPAK comment on WordPress Media Library Becomes Unusable Over Time

Thousands of images, zero control. Why it happensNo folder or taxonomy structure. Why it mattersContent reuse and SEO suffer. Smart fixUse media taxonomy plugins early.

Read More
Wordpress

WordPress Search Feels Slow on Small Sites

- 21.01.26 - ErcanOPAK comment on WordPress Search Feels Slow on Small Sites

Even with few posts, search lags. Why it happensDefault search performs full table scans. Why it mattersPoor UX even on low traffic sites. Smart fixReplace default search with indexed search plugins or custom queries.

Read More
Wordpress

WordPress REST API Feels Slow

- 18.01.26 - ErcanOPAK comment on WordPress REST API Feels Slow

API works but response time hurts. WhyUncached database queries per request. TipCache REST responses using transients.

Read More
Wordpress

WordPress Pages Break After Theme Update

- 18.01.26 - ErcanOPAK comment on WordPress Pages Break After Theme Update

No plugin change, layout ruined. WhyTheme update overwrote custom CSS. TipAlways place custom CSS in child theme or Customizer.

Read More
Wordpress

WordPress Pages Randomly Lose Formatting

- 16.01.26 - ErcanOPAK comment on WordPress Pages Randomly Lose Formatting

Refresh fixes it sometimes. WhyConflicting cache layers (plugin + server). TipUse a single authoritative caching layer.

Read More
Wordpress

WordPress Admin Feels Slow but Frontend Is Fast

- 16.01.26 - ErcanOPAK comment on WordPress Admin Feels Slow but Frontend Is Fast

Visitors fine, editor painful. WhyToo many admin-side hooks and plugins. TipAudit plugins that affect admin only.

Read More
Wordpress

WordPress Backup Files Quietly Consume Disk

- 15.01.26 - ErcanOPAK comment on WordPress Backup Files Quietly Consume Disk

Backups exist… everywhere. WhyMultiple plugins store backups independently. TipCentralize backups and delete plugin-level archives.

Read More
Wordpress

WordPress Pages Look Different After Theme Updates

- 15.01.26 - ErcanOPAK comment on WordPress Pages Look Different After Theme Updates

Content unchanged, layout broken. WhyTheme updates modify default CSS assumptions. TipAvoid relying on theme default styles for critical layout.

Read More
Wordpress

WordPress Media URLs Break After Migration

- 14.01.26 - ErcanOPAK comment on WordPress Media URLs Break After Migration

Images disappear after moving sites. WhyHardcoded URLs inside post content. TipAlways run a search-replace after migrations.

Read More
Wordpress

WordPress Sites Age Poorly Without Breaking

- 14.01.26 - ErcanOPAK comment on WordPress Sites Age Poorly Without Breaking

No errors — just slower every month. WhyOptions table grows endlessly. TipAudit autoloaded options regularly.

Read More
Wordpress

WordPress Databases Age Faster Than Expected

- 13.01.26 - ErcanOPAK comment on WordPress Databases Age Faster Than Expected

Site works… until backups get huge. WhyPost revisions and transients accumulate silently. Maintenance Tip Limit revisions and clean expired transients regularly.

Read More
Wordpress

WordPress Admin Loads Plugins You Don’t Use

- 13.01.26 - ErcanOPAK comment on WordPress Admin Loads Plugins You Don’t Use

Even inactive features affect performance. WhySome plugins hook into admin globally. Tip Remove plugins entirely instead of just disabling.

Read More
Wordpress

WordPress Media Library Becomes Unusable

- 12.01.26 - ErcanOPAK comment on WordPress Media Library Becomes Unusable

Thousands of images, endless scrolling. WhyNo pagination optimization in default media queries. Tip Limit attachments loaded per request.

Read More
Page 3 of 5
« Previous 1 2 3 4 5 Next »

Posts navigation

Older posts
Newer posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

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