<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ali Karbasi</title>
    <description>The latest articles on DEV Community by Ali Karbasi (@alikarbasicom).</description>
    <link>https://dev.to/alikarbasicom</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3948920%2F18760812-08a6-4b36-a709-d9b5c14c2291.jpeg</url>
      <title>DEV Community: Ali Karbasi</title>
      <link>https://dev.to/alikarbasicom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alikarbasicom"/>
    <language>en</language>
    <item>
      <title>The "AI" Label Is Losing Its Meaning, and Companies Are the Ones Diluting It</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 18:22:06 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/the-ai-label-is-losing-its-meaning-and-companies-are-the-ones-diluting-it-1bml</link>
      <guid>https://dev.to/alikarbasicom/the-ai-label-is-losing-its-meaning-and-companies-are-the-ones-diluting-it-1bml</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on May 24, 2026&lt;/li&gt;
&lt;li&gt;5 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article examines how the term "artificial intelligence" has been co-opted by companies as a marketing buzzword, often attached to products that have little to no genuine AI capability. Using Apple Intelligence and its $250 million false advertising settlement as a case study, the piece argues that this trend of "AI washing" is eroding public trust, confusing ordinary users, and making it harder to recognize the technology when it actually delivers real value.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every product in 2026 is "AI-powered." Your toothbrush is AI-powered. Your coffee maker is AI-powered. The spreadsheet app you have been using for ten years just got a rebrand, and now it is "AI-powered" too. Nothing changed except the logo and a press release.&lt;/p&gt;

&lt;p&gt;I have been watching this happen for two years now, and I think we have reached a tipping point. The word "AI" has been stretched so thin by marketing departments that it is starting to mean absolutely nothing to the average person.&lt;/p&gt;

&lt;p&gt;And the companies doing the stretching are not scrappy startups trying to get attention. They are some of the biggest names in tech.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Apple Intelligence Fiasco
&lt;/h2&gt;

&lt;p&gt;Let us talk about the elephant in the room. Apple.&lt;/p&gt;

&lt;p&gt;In September 2024, Apple launched the iPhone 16 series with a massive marketing push around "Apple Intelligence." The keynote was slick. The ads were everywhere. The message was clear: this phone is smart, and it is smart because of AI.&lt;/p&gt;

&lt;p&gt;There was just one small problem. The AI features were not ready.&lt;/p&gt;

&lt;p&gt;When people bought their shiny new iPhone 16, they discovered that most of the flagship "Apple Intelligence" features were either delayed, incomplete, or straight-up missing. The notification summaries hallucinated. Siri was still Siri. The "intelligent" features that were supposed to justify the upgrade were nowhere to be found at launch.&lt;/p&gt;

&lt;p&gt;Apple had sold a promise, not a product.&lt;/p&gt;

&lt;p&gt;In 2025, a class-action lawsuit was filed alleging false advertising. The plaintiffs argued that Apple had used AI capabilities as a primary selling point for the iPhone 16 lineup, knowing full well that those capabilities were not available at the time of purchase. And they had a point. If you watch those launch ads again, Apple Intelligence was not presented as a "coming soon" feature. It was presented as a reason to buy the phone &lt;em&gt;right now&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Apple settled for $250 million. The settlement covers anyone who bought an iPhone 16 (any model) or an iPhone 15 Pro/Pro Max between June 2024 and March 2025. Eligible buyers could receive between $25 and $95 per device. The final approval hearing is scheduled for June 2026.&lt;/p&gt;

&lt;p&gt;Let that sink in. A quarter of a billion dollars. Because a company slapped the word "Intelligence" on features that did not exist yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Washing Is the New Greenwashing
&lt;/h2&gt;

&lt;p&gt;Apple is not alone. What happened with Apple Intelligence is just the most visible example of a much bigger trend that the industry is now calling "AI washing."&lt;/p&gt;

&lt;p&gt;If you were around in the 2010s, you remember greenwashing. That is when companies would slap a green leaf on their packaging and call themselves "eco-friendly" without actually changing anything about their manufacturing process. The label was meaningless, but it sold products.&lt;/p&gt;

&lt;p&gt;AI washing is the exact same playbook. And it is everywhere.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Presto Automation&lt;/strong&gt; was charged by the SEC in early 2025 for claiming it used proprietary AI technology in its drive-through automation system. In reality, it was using third-party tools and heavy human intervention behind the scenes. The "AI" was basically people in a call center.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Companies laying off workers&lt;/strong&gt; have started citing "AI efficiency" as the reason for the cuts, even when the layoffs are clearly driven by financial restructuring or overhiring corrections. AI becomes the convenient scapegoat. "We are not firing people because we made bad decisions. We are firing people because the robots are just that good." Even Sam Altman has called this out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The FTC&lt;/strong&gt; has taken enforcement actions against multiple companies, including Growth Cave, Air AI, and Cox Media Group, for misrepresenting what their so-called AI products actually do.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pattern is always the same. Take an existing product. Add the letters "AI" to the name. Watch the stock price go up or the customers flood in. Hope nobody looks under the hood.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Hurts Everyone
&lt;/h2&gt;

&lt;p&gt;Here is why I care about this as a developer, and why you should too.&lt;/p&gt;

&lt;p&gt;When every company calls everything "AI," the word loses its signal. The average person, your mom, your client, your neighbor, can no longer tell the difference between a genuine AI system and a glorified if-else statement with a chatbot skin.&lt;/p&gt;

&lt;p&gt;I see this constantly in my web design work. Clients come to me and say, "We need AI on our website." When I ask what they mean, they usually describe something that is not AI at all. They want a FAQ section. They want a contact form that auto-responds. They want a product filter that remembers preferences. These are useful features, but they are not artificial intelligence. They are just good UX.&lt;/p&gt;

&lt;p&gt;But because every SaaS tool they use has told them it is "AI-powered," they now think any moderately smart feature qualifies. The bar has been lowered so far that "AI" now means "it does something automatically."&lt;/p&gt;

&lt;p&gt;This creates two real problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Trust erosion:&lt;/strong&gt; When people buy an "AI-powered" product and it does not feel intelligent at all, they stop trusting the label entirely. And then when something genuinely impressive comes along, like actual real-time language translation or meaningful code generation, they are already skeptical. "Sure, they say it is AI. The last thing that said it was AI was my toaster."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Budget misallocation:&lt;/strong&gt; Businesses are spending real money on "AI solutions" that are just repackaged automation. I have seen small e-commerce clients drop thousands on an "AI marketing platform" that turned out to be a basic email scheduler with a fancy dashboard. That money could have gone toward actual improvements to their site speed, their UX, or their conversion funnel.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The "Intelligence" Bar Is on the Floor
&lt;/h2&gt;

&lt;p&gt;Part of the problem is that nobody has agreed on what "AI" actually means in a consumer context.&lt;/p&gt;

&lt;p&gt;In academia, artificial intelligence refers to systems that can learn, reason, adapt, and make decisions in novel situations. That is a high bar. GPT-4, Claude, Gemini, these models genuinely clear that bar in meaningful ways. They can synthesize information, generate creative output, and handle tasks they were never explicitly trained for.&lt;/p&gt;

&lt;p&gt;But in marketing? "AI" just means "we added an algorithm." A spam filter is AI. A recommendation engine is AI. Auto-brightness on your phone is AI. Predictive text is AI.&lt;/p&gt;

&lt;p&gt;When you define AI that broadly, the word becomes meaningless. It is like calling every vehicle a "spaceship." A bicycle technically transports you through space, but nobody is going to be impressed when you tell them you arrived on a spaceship and they see a bicycle parked outside.&lt;/p&gt;

&lt;p&gt;Apple calling Siri "intelligent" is a bit like parking a bicycle and calling it a spaceship. The word is doing a lot of heavy lifting that the product cannot support.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Real AI Looks Like (And Why It Matters)
&lt;/h2&gt;

&lt;p&gt;I want to be clear about something. I am not anti-AI. I have written extensively about AI on this blog. I think AI coding tools are powerful when used correctly. I think AI agents are going to transform how we manage websites. I have seen firsthand what &lt;a href="https://alikarbasi.com/blog/ai-agents-are-coming-for-your-wordpress-admin-panel-and-thats-not-a-bad-thing" rel="noopener noreferrer"&gt;AI agents can do in a WordPress environment&lt;/a&gt;, and it is genuinely impressive.&lt;/p&gt;

&lt;p&gt;But those tools work because they are backed by actual large language models with billions of parameters, trained on massive datasets, capable of reasoning about novel problems. That is real AI. That is the thing worth getting excited about.&lt;/p&gt;

&lt;p&gt;The problem is not AI itself. The problem is the label being used as a costume. When a company puts "AI" on a product that is really just a rules engine or a basic automation script, it cheapens the actual breakthroughs. It makes people tired of the word before they ever get to experience the real thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Developer's Responsibility
&lt;/h2&gt;

&lt;p&gt;As developers and designers, I think we have a small but important role here.&lt;/p&gt;

&lt;p&gt;When a client asks for "AI features," we should be honest about what they actually need. If they need a chatbot, give them a chatbot and call it a chatbot. If they need a recommendation engine, build one and explain how it works. Do not call it "AI-powered" if it is just filtering products by purchase history.&lt;/p&gt;

&lt;p&gt;And when we use actual AI in our workflows, like using language models to generate content or code, we should be transparent about what the AI is doing and what its limitations are. I wrote about this in my piece on &lt;a href="https://alikarbasi.com/blog/the-vibe-tax-how-unvalidated-ai-code-is-flooding-the-market-and-driving-up-technical-debt" rel="noopener noreferrer"&gt;the Vibe Tax&lt;/a&gt;. The tool is powerful, but it is not magic. Calling it magic is how you end up with $250 million lawsuits.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Verdict
&lt;/h2&gt;

&lt;p&gt;The word "AI" used to mean something. It used to carry weight. It used to make you lean forward and pay attention.&lt;/p&gt;

&lt;p&gt;Now it is on toothbrush packaging.&lt;/p&gt;

&lt;p&gt;Apple showed us what happens when a company over-promises on AI. A quarter-billion-dollar settlement and a wave of consumer distrust. But Apple is just the company that got caught. Hundreds of other companies are doing the same thing on a smaller scale, every single day.&lt;/p&gt;

&lt;p&gt;If we want AI to keep meaning something, if we want people to actually trust the technology when it delivers real value, then we need to stop letting the marketing departments turn "artificial intelligence" into the new "all-natural" or "military-grade." Those phrases are meaningless now. "AI" is heading in the same direction.&lt;/p&gt;

&lt;p&gt;The next time you see a product that claims to be AI-powered, ask yourself one question: "If I removed the AI label, would this product seem any different?"&lt;/p&gt;

&lt;p&gt;If the answer is no, you have just spotted AI washing. And unfortunately, you are going to keep spotting it everywhere.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>apple</category>
      <category>marketing</category>
      <category>openai</category>
    </item>
    <item>
      <title>Speed Up Your WordPress Site in 30 Minutes: A No-Plugin Performance Guide</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 18:14:05 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/speed-up-your-wordpress-site-in-30-minutes-a-no-plugin-performance-guide-2e3p</link>
      <guid>https://dev.to/alikarbasicom/speed-up-your-wordpress-site-in-30-minutes-a-no-plugin-performance-guide-2e3p</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on May 3, 2026&lt;/li&gt;
&lt;li&gt;6 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This practical guide walks WordPress and WooCommerce site owners through a series of hands-on performance optimizations that can be completed in 30 minutes, without installing a single caching or optimization plugin. It covers converting images to modern formats like WebP and AVIF, implementing native lazy loading, optimizing web font delivery, inlining critical CSS, cleaning up the database, and removing render-blocking resources. Each step includes real code snippets that can be dropped into a child theme's &lt;code&gt;functions.php&lt;/code&gt; file, making this a copy-paste-and-go resource for store owners who want faster load times today.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I am going to say something that might upset a few people: your WordPress site does not need fifteen plugins to be fast.&lt;/p&gt;

&lt;p&gt;I have lost count of the number of WooCommerce stores I have audited where the client installed a caching plugin, an image optimization plugin, a lazy loading plugin, a minification plugin, a database optimization plugin, and a CDN plugin, and the site was &lt;em&gt;still&lt;/em&gt; slow. In some cases, the plugins were actually fighting each other and making things worse.&lt;/p&gt;

&lt;p&gt;The truth is that WordPress, out of the box, is not as slow as people think. What makes it slow is what we pile on top of it. And the irony of installing more plugins to fix a problem caused by too many plugins is something that should keep us all up at night.&lt;/p&gt;

&lt;p&gt;So here is my challenge: set a 30-minute timer and follow this guide. No plugins. Just code, configuration, and common sense. By the time you are done, your site will be measurably faster.&lt;/p&gt;

&lt;p&gt;Let's go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 0-5: Convert Your Images to WebP or AVIF
&lt;/h2&gt;

&lt;p&gt;This is the single biggest performance win for most WordPress sites, and it is not even close.&lt;/p&gt;

&lt;p&gt;If your product images and blog thumbnails are still in JPEG or PNG format, you are serving files that are two to five times larger than they need to be. WebP delivers the same visual quality at roughly 30% smaller file sizes than JPEG. AVIF goes even further, often 50% smaller.&lt;/p&gt;

&lt;p&gt;Here is the thing: WordPress has supported WebP uploads natively since version 5.8 (2021). And as of WordPress 6.5, AVIF is also supported out of the box. You do not need a plugin for this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to do:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use a free tool like &lt;a href="https://squoosh.app" rel="noopener noreferrer"&gt;Squoosh&lt;/a&gt; (by Google) to batch convert your existing images to WebP.&lt;/li&gt;
&lt;li&gt;For new uploads, simply save your images as &lt;code&gt;.webp&lt;/code&gt; before uploading them to the Media Library.&lt;/li&gt;
&lt;li&gt;If you want WordPress to serve AVIF to browsers that support it and WebP as a fallback, you can add this to your &lt;code&gt;.htaccess&lt;/code&gt; file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="c"&gt;# Serve AVIF/WebP images if browser supports them&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;IfModule&lt;/span&gt;&lt;span class="sr"&gt; mod_rewrite.c&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="nc"&gt;RewriteEngine&lt;/span&gt; &lt;span class="ss"&gt;On&lt;/span&gt;
  &lt;span class="nc"&gt;RewriteCond&lt;/span&gt; %{HTTP_ACCEPT} image/avif
  &lt;span class="nc"&gt;RewriteCond&lt;/span&gt; %{REQUEST_FILENAME}.avif -f
  &lt;span class="nc"&gt;RewriteRule&lt;/span&gt; ^(.+)\.(jpe?g|png|gif)$ $1.$2.avif [T=image/avif,L]

  &lt;span class="nc"&gt;RewriteCond&lt;/span&gt; %{HTTP_ACCEPT} image/webp
  &lt;span class="nc"&gt;RewriteCond&lt;/span&gt; %{REQUEST_FILENAME}.webp -f
  &lt;span class="nc"&gt;RewriteRule&lt;/span&gt; ^(.+)\.(jpe?g|png|gif)$ $1.$2.webp [T=image/webp,L]
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;IfModule&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a WooCommerce store with 500 products, I have seen this single change cut total page weight by 60%. That translates directly into faster load times, especially for customers on mobile networks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 5-10: Enable Native Lazy Loading
&lt;/h2&gt;

&lt;p&gt;Lazy loading means images below the fold (the ones you cannot see without scrolling) are not loaded until the user scrolls down to them. This dramatically reduces initial page load time.&lt;/p&gt;

&lt;p&gt;The good news: WordPress has included native lazy loading since version 5.5. It automatically adds &lt;code&gt;loading="lazy"&lt;/code&gt; to images. But there are two problems with the default behavior.&lt;/p&gt;

&lt;p&gt;First, WordPress also lazy-loads images &lt;em&gt;above&lt;/em&gt; the fold, including your hero banner and first visible product images. This actually hurts your Largest Contentful Paint (LCP) score because the browser waits to load the most important image on the page.&lt;/p&gt;

&lt;p&gt;Second, iframes (like embedded YouTube videos) are not lazy-loaded by default.&lt;/p&gt;

&lt;p&gt;Add this to your child theme's &lt;code&gt;functions.php&lt;/code&gt; to fix both issues:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/**
 * Skip lazy loading for the first image (above the fold)
 * and add lazy loading to iframes
 */&lt;/span&gt;
&lt;span class="c1"&gt;// Skip lazy loading on hero/banner images&lt;/span&gt;
&lt;span class="nf"&gt;add_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_img_tag_add_loading_attr'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$image&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nv"&gt;$count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nv"&gt;$count&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// Don't lazy load the first 2 images (likely above the fold)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;'lazy'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Add lazy loading to iframes (YouTube embeds, maps, etc.)&lt;/span&gt;
&lt;span class="nf"&gt;add_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'the_content'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str_replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;iframe '&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;iframe loading="lazy" '&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is one of those changes that costs you nothing but gives you an immediate improvement in Core Web Vitals, specifically LCP and the overall page load waterfall.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 10-15: Optimize Your Web Fonts
&lt;/h2&gt;

&lt;p&gt;Fonts are a silent performance killer. Most WordPress themes load Google Fonts by making a round-trip request to &lt;code&gt;fonts.googleapis.com&lt;/code&gt;, then another to &lt;code&gt;fonts.gstatic.com&lt;/code&gt;, then downloading the actual font files. That is three network hops before your text even renders.&lt;/p&gt;

&lt;p&gt;Here is how to fix it in three steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Add preconnect hints.&lt;/strong&gt; This tells the browser to start the connection to the font server early. Add this to your theme's &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"preconnect"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.googleapis.com"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"preconnect"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://fonts.gstatic.com"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Use &lt;code&gt;font-display: swap&lt;/code&gt;.&lt;/strong&gt; This tells the browser to show the text immediately using a system font, then swap in the custom font once it has loaded. No more invisible text while fonts download. When loading Google Fonts, append &lt;code&gt;&amp;amp;display=swap&lt;/code&gt; to the URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&amp;amp;display=swap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Self-host your fonts.&lt;/strong&gt; This is the biggest win. Instead of loading fonts from Google's servers, download them and serve them from your own domain. This eliminates the DNS lookup and connection overhead entirely.&lt;/p&gt;

&lt;p&gt;Download your fonts from &lt;a href="https://gwfh.mranftl.com/fonts" rel="noopener noreferrer"&gt;Google Webfonts Helper&lt;/a&gt;, place them in your theme's &lt;code&gt;/fonts/&lt;/code&gt; directory, and add a &lt;code&gt;@font-face&lt;/code&gt; declaration to your CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@font-face&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'Inter'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;normal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;font-display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;swap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url('/wp-content/themes/your-child-theme/fonts/inter-v18-latin-regular.woff2')&lt;/span&gt;
         &lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;'woff2'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then remove the Google Fonts stylesheet from your theme. If your parent theme enqueues it, dequeue it in your child theme:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_enqueue_scripts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;wp_dequeue_style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'google-fonts'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;wp_deregister_style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'google-fonts'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On one WooCommerce store I optimized, self-hosting fonts alone shaved 400ms off the initial render time. That is almost half a second just from eliminating external font requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 15-20: Inline Critical CSS and Defer the Rest
&lt;/h2&gt;

&lt;p&gt;By default, WordPress loads your entire stylesheet as a render-blocking resource. This means the browser has to download and parse your complete CSS file before it can paint anything on screen, even if 90% of that CSS is for pages the user has not visited yet.&lt;/p&gt;

&lt;p&gt;The fix is to inline the critical CSS (the styles needed for the above-the-fold content) directly in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, and load the rest asynchronously.&lt;/p&gt;

&lt;p&gt;Here is a practical approach without a plugin:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Use a tool like &lt;a href="https://www.toptal.com/developers/cssminify" rel="noopener noreferrer"&gt;CSS Minifier&lt;/a&gt; to minify your stylesheet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Extract your critical CSS. You can use the free &lt;a href="https://criticalcss.com" rel="noopener noreferrer"&gt;Critical CSS Generator&lt;/a&gt; to identify which styles are needed for the initial viewport. This typically includes your header, navigation, hero section, and first row of products.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Inline that critical CSS and defer the full stylesheet. Add this to your &lt;code&gt;functions.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Inline critical CSS&lt;/span&gt;
    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;style id="critical-css"&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// Paste your minified critical CSS here&lt;/span&gt;
    &lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="nf"&gt;get_stylesheet_directory&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;'/critical.css'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;/style&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_enqueue_scripts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Change main stylesheet to load asynchronously&lt;/span&gt;
    &lt;span class="nf"&gt;wp_dequeue_style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'theme-style'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;wp_enqueue_style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'theme-style'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nf"&gt;get_stylesheet_uri&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'print'&lt;/span&gt; &lt;span class="c1"&gt;// Load as print, then swap to all&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Add onload handler to swap media to "all"&lt;/span&gt;
    &lt;span class="nf"&gt;add_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'style_loader_tag'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$handle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$handle&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'theme-style'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$html&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str_replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s2"&gt;"media='print'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"media='print' onload=&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;this.media='all'&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="nv"&gt;$html&lt;/span&gt;
            &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This technique makes your page visually complete in a fraction of the time because the browser does not have to wait for the full stylesheet. Users see content immediately, and the rest of the styles load quietly in the background.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 20-25: Clean Up Your Database
&lt;/h2&gt;

&lt;p&gt;This one is especially important for WooCommerce stores. Over time, your WordPress database accumulates a shocking amount of junk:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Post revisions:&lt;/strong&gt; WordPress saves every single draft of every post and page. A store with 500 products might have 5,000+ revision entries doing absolutely nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transients:&lt;/strong&gt; Temporary cached data that often outlives its usefulness. Expired transients just sit in the database taking up space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spam and trashed comments:&lt;/strong&gt; Self-explanatory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Orphaned post meta:&lt;/strong&gt; Metadata left behind by plugins you uninstalled months ago.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WooCommerce sessions:&lt;/strong&gt; Expired customer session data that can grow to thousands of rows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can clean all of this up with a few SQL queries. Connect to your database via phpMyAdmin or a MySQL client and run these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Delete all post revisions&lt;/span&gt;
&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_posts&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;post_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'revision'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Delete expired transients&lt;/span&gt;
&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_options&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;option_name&lt;/span&gt;
    &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="s1"&gt;'%&lt;/span&gt;&lt;span class="se"&gt;\_&lt;/span&gt;&lt;span class="s1"&gt;transient&lt;/span&gt;&lt;span class="se"&gt;\_&lt;/span&gt;&lt;span class="s1"&gt;%'&lt;/span&gt;
    &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;option_name&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="s1"&gt;'%&lt;/span&gt;&lt;span class="se"&gt;\_&lt;/span&gt;&lt;span class="s1"&gt;transient&lt;/span&gt;&lt;span class="se"&gt;\_&lt;/span&gt;&lt;span class="s1"&gt;timeout&lt;/span&gt;&lt;span class="se"&gt;\_&lt;/span&gt;&lt;span class="s1"&gt;%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Delete spam and trashed comments&lt;/span&gt;
&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;wp_comments&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;comment_approved&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'spam'&lt;/span&gt;
    &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="n"&gt;comment_approved&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trash'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Optimize all tables&lt;/span&gt;
&lt;span class="c1"&gt;-- (run this after the cleanup queries above)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Always back up your database before running any SQL queries. Always. I do not care how confident you are. Back it up.&lt;/p&gt;

&lt;p&gt;To prevent revision bloat from coming back, add this line to your &lt;code&gt;wp-config.php&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Limit post revisions to 3&lt;/span&gt;
&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'WP_POST_REVISIONS'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This keeps the safety net of revisions while preventing the database from growing endlessly. On a WooCommerce store I worked on last year, cleaning up revisions and expired transients alone reduced the database size from 800MB to 120MB. The difference in query speed was immediately noticeable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minute 25-30: Remove Render-Blocking Resources
&lt;/h2&gt;

&lt;p&gt;The final step is to audit what WordPress is injecting into your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; that you do not actually need. By default, WordPress adds quite a bit of extra weight:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The emoji script (yes, WordPress loads a JavaScript file just for emojis)&lt;/li&gt;
&lt;li&gt;The embed script for oEmbed&lt;/li&gt;
&lt;li&gt;jQuery Migrate (a compatibility layer for old plugins that most modern themes do not need)&lt;/li&gt;
&lt;li&gt;The RSS feed links&lt;/li&gt;
&lt;li&gt;The Windows Live Writer manifest&lt;/li&gt;
&lt;li&gt;The WordPress version number (which is also a security risk)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add this to your &lt;code&gt;functions.php&lt;/code&gt; to clean it all up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/**
 * Remove unnecessary head resources
 */&lt;/span&gt;
&lt;span class="c1"&gt;// Remove emoji scripts and styles&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'print_emoji_detection_script'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_print_styles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'print_emoji_styles'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'admin_print_scripts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'print_emoji_detection_script'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'admin_print_styles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'print_emoji_styles'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Remove embed script&lt;/span&gt;
&lt;span class="nf"&gt;wp_deregister_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp-embed'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Remove WordPress version number&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wp_generator'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Remove Windows Live Writer manifest&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wlwmanifest_link'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Remove RSS feed links (if you don't use RSS)&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'feed_links'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'feed_links_extra'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Remove REST API link&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'rest_output_link_wp_head'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Remove oEmbed discovery links&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wp_oembed_add_discovery_links'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Remove shortlink&lt;/span&gt;
&lt;span class="nf"&gt;remove_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'wp_shortlink_wp_head'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For jQuery Migrate, be careful. Test your site after removing it, because some older plugins still depend on it. If everything works fine without it, add this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_default_scripts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$scripts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;is_admin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;isset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$scripts&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;registered&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'jquery'&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$script&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$scripts&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;registered&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'jquery'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$script&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;deps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$script&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;deps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;array_diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$script&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;deps&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'jquery-migrate'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Results
&lt;/h2&gt;

&lt;p&gt;If you followed all six steps, here is what you have done in 30 minutes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduced image sizes by 30-50% (WebP/AVIF conversion)&lt;/li&gt;
&lt;li&gt;Eliminated unnecessary image loading on initial page load (smart lazy loading)&lt;/li&gt;
&lt;li&gt;Removed external font requests and eliminated invisible text flash (font optimization)&lt;/li&gt;
&lt;li&gt;Made the above-the-fold content render without waiting for the full stylesheet (critical CSS)&lt;/li&gt;
&lt;li&gt;Shrunk your database and sped up queries (database cleanup)&lt;/li&gt;
&lt;li&gt;Removed 6+ unnecessary scripts and meta tags from your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; (resource cleanup)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the last WooCommerce store where I applied all of these changes together, the results were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LCP (Largest Contentful Paint):&lt;/strong&gt; from 4.2s to 1.8s&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total page weight:&lt;/strong&gt; from 3.8MB to 1.1MB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of HTTP requests:&lt;/strong&gt; from 47 to 22&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PageSpeed Insights score:&lt;/strong&gt; from 38 to 91&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No caching plugin. No optimization plugin. No CDN (though you should use one too). Just fundamentals.&lt;/p&gt;

&lt;h2&gt;
  
  
  One Last Thing
&lt;/h2&gt;

&lt;p&gt;I want to be clear: I am not saying plugins are bad. There are excellent caching plugins and CDN integrations that absolutely have their place. What I am saying is that installing plugins &lt;em&gt;before&lt;/em&gt; fixing the basics is like putting a turbocharger on a car with flat tires.&lt;/p&gt;

&lt;p&gt;Fix the tires first. Then add the turbo.&lt;/p&gt;

&lt;p&gt;The steps in this guide are the tires. They are the foundational performance wins that every WordPress and WooCommerce site should have, regardless of what plugins you add on top. And the best part is that these changes are permanent. They do not depend on a plugin being maintained, updated, or compatible with your next theme.&lt;/p&gt;

&lt;p&gt;Your code, your performance, your control.&lt;/p&gt;

&lt;p&gt;Happy coding :D&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>webdev</category>
      <category>performance</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>AI Agents Are Coming for Your WordPress Admin Panel, and That's Not a Bad Thing</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 17:52:25 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/ai-agents-are-coming-for-your-wordpress-admin-panel-and-thats-not-a-bad-thing-1fff</link>
      <guid>https://dev.to/alikarbasicom/ai-agents-are-coming-for-your-wordpress-admin-panel-and-thats-not-a-bad-thing-1fff</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Apr 25, 2026&lt;/li&gt;
&lt;li&gt;5 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article explores the rise of AI agents in the WordPress ecosystem and what it means for web developers. While autonomous AI is beginning to handle routine admin tasks like inventory management, SEO optimization, and customer support, the author argues this shift creates more opportunities for skilled developers, not fewer. The piece draws on real-world examples to show that AI agents still need human architects to configure, supervise, and rescue them when they inevitably break, making the WordPress developer's role more strategic than ever.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have been building WordPress sites since the days when "responsive design" meant adding a single media query and hoping for the best. Over that time, I have watched the platform survive every existential threat thrown at it. Squarespace was going to kill it. Wix was going to kill it. Headless CMS was going to kill it. Webflow was definitely going to kill it.&lt;/p&gt;

&lt;p&gt;WordPress is still here, powering over 40% of the web.&lt;/p&gt;

&lt;p&gt;But this time, the threat feels different. Because the thing coming for WordPress isn't another website builder. It is something that doesn't build websites at all. It is something that &lt;em&gt;runs&lt;/em&gt; them.&lt;/p&gt;

&lt;p&gt;I am talking about AI agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are AI Agents, and Why Should You Care?
&lt;/h2&gt;

&lt;p&gt;If you have been paying attention to the tech world in 2026, you have heard the term "AI agents" roughly nine thousand times. But let me cut through the hype and explain what they actually are in practical terms.&lt;/p&gt;

&lt;p&gt;An AI agent is not a chatbot. A chatbot waits for you to ask it something, gives you an answer, and stops. An AI agent is autonomous. You give it a goal, and it figures out the steps, executes them, and keeps going until the job is done. It can use tools, make decisions, and chain multiple actions together.&lt;/p&gt;

&lt;p&gt;Think of it this way: ChatGPT is like texting a smart friend for advice. An AI agent is like hiring an employee who shows up, reads the manual, and starts working without being told every single step.&lt;/p&gt;

&lt;p&gt;Now imagine that employee has access to your WordPress admin panel.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Agents Are Already Doing in WordPress
&lt;/h2&gt;

&lt;p&gt;This is not hypothetical. It is happening right now. Here is what AI agents are starting to handle in the WordPress and WooCommerce ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inventory management:&lt;/strong&gt; Agents that monitor stock levels, automatically reorder from suppliers, and update product statuses. Remember my post about &lt;a href="https://alikarbasi.com/blog/how-to-hide-out-of-stock-products-on-your-wordpress-website" rel="noopener noreferrer"&gt;hiding out-of-stock products&lt;/a&gt;? An agent doesn't just hide them; it restocks them before they even run out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO optimization:&lt;/strong&gt; Agents that crawl your pages, rewrite meta descriptions, optimize image alt text, fix internal linking, and submit updated sitemaps to Google. All while you sleep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customer support:&lt;/strong&gt; Agents that handle order inquiries, process refunds, and update shipping information. Not canned responses, actual contextual understanding of the customer's order history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content scheduling and updates:&lt;/strong&gt; Agents that audit your blog posts, update outdated information, flag broken links, and even draft new posts based on trending keywords in your niche.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security monitoring:&lt;/strong&gt; Agents that watch your access logs, detect suspicious login attempts, patch vulnerable plugins, and alert you only when something genuinely needs human attention.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A year ago, each of these tasks required either a dedicated plugin (or three), a virtual assistant, or you doing it yourself at midnight. Now, a single AI agent with the right permissions can handle all of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "But It Will Replace Us" Panic
&lt;/h2&gt;

&lt;p&gt;I know what you are thinking, because I thought it too.&lt;/p&gt;

&lt;p&gt;"If an AI agent can manage a WordPress site, why would anyone hire me to do it?"&lt;/p&gt;

&lt;p&gt;This is the same fear I wrote about in my &lt;a href="https://alikarbasi.com/blog/the-death-of-the-junior-developer-is-greatly-exaggerated" rel="noopener noreferrer"&gt;junior developer article&lt;/a&gt;. And the answer is the same: the tool is not the job. The job is knowing &lt;em&gt;when and how&lt;/em&gt; to use the tool.&lt;/p&gt;

&lt;p&gt;Let me give you a real example.&lt;/p&gt;

&lt;p&gt;A client I work with runs a WooCommerce store with about 2,000 products. They set up an AI agent to manage their product descriptions. The agent was supposed to optimize them for SEO. And it did. Beautifully. Every product description was rewritten with keywords, proper structure, and compelling copy.&lt;/p&gt;

&lt;p&gt;There was just one problem.&lt;/p&gt;

&lt;p&gt;The agent changed the product descriptions for items that had legal compliance requirements. Supplement labels, safety warnings, certifications. The agent didn't know those descriptions were legally mandated. It just saw "poorly optimized text" and "fixed" it.&lt;/p&gt;

&lt;p&gt;The store was flagged by their payment processor within a week.&lt;/p&gt;

&lt;p&gt;Who fixed it? Not the agent. A developer who understood the business context, rolled back the changes, and set up guardrails so the agent couldn't touch compliance-sensitive fields.&lt;/p&gt;

&lt;h2&gt;
  
  
  The New WordPress Developer Role
&lt;/h2&gt;

&lt;p&gt;This is where I think our profession is heading. And honestly, I think it is a more interesting job than what we had before.&lt;/p&gt;

&lt;p&gt;The old WordPress developer role was roughly this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install WordPress&lt;/li&gt;
&lt;li&gt;Pick a theme&lt;/li&gt;
&lt;li&gt;Install 47 plugins&lt;/li&gt;
&lt;li&gt;Customize CSS until the client is happy&lt;/li&gt;
&lt;li&gt;Pray nothing breaks on update day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The new WordPress developer role is becoming this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agent Architect:&lt;/strong&gt; Deciding which tasks should be automated and which need human oversight. Setting up the agent's permissions, scope, and boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration Engineer:&lt;/strong&gt; Connecting AI agents to WooCommerce APIs, payment gateways, CRMs, and third-party services. This requires understanding both the WordPress ecosystem and the new agent protocols like MCP (Model Context Protocol).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrail Designer:&lt;/strong&gt; Building the safety nets. What can the agent change? What requires approval? What is completely off-limits? This is the compliance and risk layer that no AI can design for itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rescue Squad:&lt;/strong&gt; When the agent breaks something (and it will), you are the one who understands the system well enough to fix it. This is the same argument I made in my &lt;a href="https://alikarbasi.com/blog/vibe-coding-vs-system-architecture-why-it-works-is-not-the-same-as-it-scales" rel="noopener noreferrer"&gt;Vibe Coding vs. System Architecture&lt;/a&gt; post: the market pays you for what you do when things go wrong, not when things go right.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Plugin Graveyard
&lt;/h2&gt;

&lt;p&gt;Here is a prediction I feel fairly confident about: AI agents are going to kill a significant number of WordPress plugins.&lt;/p&gt;

&lt;p&gt;Think about it. Why would you install a dedicated SEO plugin, a caching plugin, an image optimization plugin, a broken link checker, a redirect manager, and a security scanner when a single AI agent can handle all of those tasks dynamically?&lt;/p&gt;

&lt;p&gt;The plugin model is fundamentally static. You install it, configure it once, and it does the same thing forever until you update it. An agent is dynamic. It adapts. It learns your site's patterns. It doesn't need a settings page because it figures out the optimal settings itself.&lt;/p&gt;

&lt;p&gt;This does not mean all plugins are dead. Complex functionality like WooCommerce itself, page builders, and specialized tools will survive. But the "utility" plugins, the ones that do one simple thing, are going to be absorbed by agents.&lt;/p&gt;

&lt;p&gt;And here is the twist: this is &lt;em&gt;good&lt;/em&gt; for WordPress performance. One of the biggest complaints about WordPress has always been plugin bloat. If agents replace twenty plugins with a single intelligent process, sites get faster, more secure, and easier to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Should Do Right Now
&lt;/h2&gt;

&lt;p&gt;If you are a WordPress developer reading this, here is my honest advice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Learn how AI agents work:&lt;/strong&gt; Not at a PhD level. Just understand the basics: what an agent is, how it chains actions, what MCP and tool-use patterns look like. You do not need to build an agent from scratch; you need to know how to configure and supervise one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Get comfortable with APIs:&lt;/strong&gt; The WordPress REST API is about to become the most important part of your skill set. Agents interact with WordPress through APIs, not through the admin panel. If you have been avoiding the REST API, now is the time to learn it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Think in permissions, not features:&lt;/strong&gt; The old question was "What plugin should I install?" The new question is "What should this agent be allowed to do?" Start thinking about WordPress management as an access control problem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep your WooCommerce knowledge sharp:&lt;/strong&gt; E-commerce is the area where AI agents will have the biggest impact first, because there is the most repetitive work to automate. Your WooCommerce expertise is about to become more valuable, not less.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document everything:&lt;/strong&gt; Agents need context to work well. The better you document a client's business rules, content guidelines, and compliance requirements, the better the agent will perform, and the more the client will need you to maintain that documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Verdict
&lt;/h2&gt;

&lt;p&gt;AI agents are not coming to replace WordPress developers. They are coming to replace the most boring parts of the WordPress developer's job.&lt;/p&gt;

&lt;p&gt;The manual updates. The repetitive SEO tweaks. The "can you change this button color" tickets. The midnight stock-level checks. Those are agent territory now.&lt;/p&gt;

&lt;p&gt;What is left for us? The interesting stuff. The architecture. The strategy. The "your agent just deleted all your product reviews and I need to fix it" emergencies.&lt;/p&gt;

&lt;p&gt;The developers who treat AI agents as a threat will be competing against a tool they refuse to understand. The developers who treat AI agents as a &lt;em&gt;power tool&lt;/em&gt; will be the ones building, configuring, and supervising the systems that run the next generation of WordPress sites.&lt;/p&gt;

&lt;p&gt;The admin panel is getting a new operator. Your job is to make sure that operator doesn't burn the house down.&lt;/p&gt;

&lt;p&gt;And trust me, that job is not going anywhere.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>wordpress</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Death of the Junior Developer Is Greatly Exaggerated</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 17:34:06 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/the-death-of-the-junior-developer-is-greatly-exaggerated-d9n</link>
      <guid>https://dev.to/alikarbasicom/the-death-of-the-junior-developer-is-greatly-exaggerated-d9n</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Feb 13, 2026&lt;/li&gt;
&lt;li&gt;4 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article pushes back on the popular narrative that AI coding tools will eliminate the need for junior developers. It argues that while AI has changed the entry point into software engineering, juniors who learn alongside AI are developing a hybrid skill set that makes them more capable, not less relevant. The piece warns that companies cutting junior roles to rely on AI are sabotaging their own talent pipelines, creating a "missing generation" of mid-level engineers that will haunt them within three to five years.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every week, I see a new LinkedIn post from a tech CEO declaring that junior developers are finished. "Why would I hire someone with zero experience when I can just use AI?" they say, usually accompanied by a screenshot of ChatGPT writing a React component in twelve seconds.&lt;/p&gt;

&lt;p&gt;And honestly, I get the logic. On paper, it makes sense. If the machine can write the code, why pay someone to learn how to write it?&lt;/p&gt;

&lt;p&gt;But this take is so shortsighted it makes my eyes hurt.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Just Use AI" Fallacy
&lt;/h2&gt;

&lt;p&gt;Here is what the "replace juniors with AI" crowd doesn't understand: you are not hiring a junior developer to write code. You are hiring them to &lt;strong&gt;become&lt;/strong&gt; the senior developer you will desperately need in three years.&lt;/p&gt;

&lt;p&gt;Junior roles have never been about immediate output. They are an investment in your future engineering bench. It is like a football club saying, "Why do we need an academy? We can just buy finished players." Sure, until the transfer market dries up and you have no pipeline.&lt;/p&gt;

&lt;p&gt;And that is exactly what is happening. The companies slashing junior positions today are going to be in a bidding war for senior talent in 2029, wondering where all the mid-level engineers went.&lt;/p&gt;

&lt;p&gt;They didn't go anywhere. They were never created.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Junior + AI = Something New
&lt;/h2&gt;

&lt;p&gt;Here is the part that actually excites me.&lt;/p&gt;

&lt;p&gt;The juniors who are entering the industry &lt;em&gt;right now&lt;/em&gt;, in 2026, are not the same juniors we had in 2019. They are growing up with AI as a native tool. They don't see it as a crutch or a threat. They see it as a power tool, like a drill versus a screwdriver.&lt;/p&gt;

&lt;p&gt;I have been watching junior developers on my team use AI, and something interesting happens. They don't just blindly paste the output. The good ones are doing something I rarely saw before:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;They ask the AI to explain its reasoning.&lt;/strong&gt; Not just "give me the code" but "why did you use a Map instead of an Object here?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They cross-reference the output.&lt;/strong&gt; They check the docs. They test edge cases. They are skeptical.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They learn faster.&lt;/strong&gt; What used to take six months of Stack Overflow rabbit holes now takes six weeks of targeted AI-assisted exploration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These AI-native juniors are developing at an accelerated pace. They still make mistakes, obviously. But they are making &lt;em&gt;different&lt;/em&gt; mistakes. More interesting ones. Higher-level ones. They are skipping the "how do I center a div?" phase and getting to the "should this be server-rendered or client-rendered?" phase much sooner.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Missing Generation" Problem
&lt;/h2&gt;

&lt;p&gt;Let me paint you a picture of what happens if the industry actually follows through on cutting junior roles.&lt;/p&gt;

&lt;p&gt;Right now, a healthy engineering team looks like a pyramid. A few seniors at the top, a solid layer of mid-levels in the middle, and a wide base of juniors at the bottom. The juniors learn from the mids, the mids learn from the seniors, and the whole thing flows upward over time.&lt;/p&gt;

&lt;p&gt;Now remove the bottom layer.&lt;/p&gt;

&lt;p&gt;In three years, those mid-levels become your seniors. But who replaces them? There is nobody. You skipped a generation. You now have a top-heavy team of expensive seniors with no one beneath them to delegate to, mentor, or promote.&lt;/p&gt;

&lt;p&gt;So what do you do? You post a job listing for a "mid-level developer with 3-5 years experience." But the candidates don't exist because nobody hired them when they were juniors. The talent pool has a hole in it, and it is a hole you created.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Actually Changed (And What Didn't)
&lt;/h2&gt;

&lt;p&gt;Let me be clear about what AI &lt;em&gt;did&lt;/em&gt; change for juniors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The bar for "entry-level output" is higher.&lt;/strong&gt; A junior today is expected to ship more, faster, than a junior five years ago. AI raised the floor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Syntax memorization is worthless.&lt;/strong&gt; Nobody cares if you can write a for loop from memory. AI can do that. What matters is knowing &lt;em&gt;when&lt;/em&gt; to use a for loop versus a &lt;code&gt;.map()&lt;/code&gt; versus a recursive call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The interview process needs to change.&lt;/strong&gt; If you are still asking juniors to reverse a linked list on a whiteboard, you are testing the wrong skills. Test their ability to evaluate AI output. Give them broken AI-generated code and ask them to find the bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But here is what did NOT change:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You still need people who understand systems.&lt;/strong&gt; AI doesn't understand your business logic. It doesn't know that the discount code feature your last developer built has a race condition that triggers double coupons. A human does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You still need people who can communicate.&lt;/strong&gt; Half of engineering is translating what the product manager wants into what the code should do. AI cannot sit in a meeting and say, "That feature scope is too big for this sprint."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You still need people who grow.&lt;/strong&gt; AI doesn't get promoted. It doesn't become your tech lead. It doesn't mentor the next batch of juniors. People do.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A Message to Junior Devs
&lt;/h2&gt;

&lt;p&gt;If you are a junior reading this and feeling anxious about your future, let me be blunt: you are fine.&lt;/p&gt;

&lt;p&gt;But you need to adapt. The junior role of 2020 is gone. The new junior role is not "person who writes boilerplate code." The new junior role is "person who can leverage AI to solve problems while understanding &lt;em&gt;why&lt;/em&gt; the solution works."&lt;/p&gt;

&lt;p&gt;Learn to read code more than you write it. Learn to ask "what could go wrong?" before you ask "does it work?" Learn to treat AI like a very fast, very confident coworker who sometimes lies to your face.&lt;/p&gt;

&lt;p&gt;If you can do that, you are not replaceable. You are invaluable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Verdict
&lt;/h2&gt;

&lt;p&gt;The death of the junior developer has been greatly exaggerated. What is actually dying is the &lt;em&gt;old definition&lt;/em&gt; of what a junior developer does.&lt;/p&gt;

&lt;p&gt;The companies that understand this will invest in AI-augmented junior programs and have a stacked engineering bench in five years. The companies that don't will be posting desperate LinkedIn job ads for "senior engineers, URGENT" while wondering why nobody applies.&lt;/p&gt;

&lt;p&gt;The future doesn't belong to AI alone. It belongs to the humans who know how to work with it. And the best time to start learning that skill is when you are junior.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>career</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Vibe Tax: How Unvalidated AI Code Is Flooding the Market and Driving Up Technical Debt</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 17:19:40 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/the-vibe-tax-how-unvalidated-ai-code-is-flooding-the-market-and-driving-up-technical-debt-1jd8</link>
      <guid>https://dev.to/alikarbasicom/the-vibe-tax-how-unvalidated-ai-code-is-flooding-the-market-and-driving-up-technical-debt-1jd8</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Nov 29, 2025&lt;/li&gt;
&lt;li&gt;3 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article explores "The Vibe Tax," a hidden cost associated with relying on unvalidated AI-generated code that appears correct on the surface but lacks structural integrity. While AI tools drastically increase coding speed, they often lack context and optimization, leading to bloated dependencies and disjointed "Frankenstein" codebases that are difficult to maintain. The piece argues that this accumulation of technical debt ultimately makes senior engineers more valuable than ever, as they are needed to audit AI outputs and ensure sustainable software architecture rather than just rapid delivery.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We need to talk about the bill.&lt;/p&gt;

&lt;p&gt;Right now, the tech industry is enjoying an all-you-can-eat buffet of free code. You want a landing page? Here is the HTML. You want a Python script to scrape emails? Done in seconds. It feels like we have unlocked a cheat code for productivity.&lt;/p&gt;

&lt;p&gt;But as any senior developer will tell you, there is no such thing as free code.&lt;/p&gt;

&lt;p&gt;I have started noticing a pattern in recent code reviews and freelance audits. I call it "The Vibe Tax." It is the hidden cost of pasting code that you do not fully understand, and it is about to become the most expensive line item in software development.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Frankenstein" Codebase
&lt;/h2&gt;

&lt;p&gt;The problem with AI generation isn't that the code is wrong. Often, it is technically correct. The problem is that AI has zero sense of context.&lt;/p&gt;

&lt;p&gt;If you ask ChatGPT to write a function to format a date in three different parts of your app, it might give you three completely different solutions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One uses &lt;code&gt;moment.js&lt;/code&gt; (which is huge and outdated).&lt;/li&gt;
&lt;li&gt;One uses a custom regex (which is fragile).&lt;/li&gt;
&lt;li&gt;One uses the native Date object (which is quirky).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They all work. The "vibe" is consistent. But your codebase is now a Frankenstein monster of conflicting styles and unnecessary dependencies.&lt;/p&gt;

&lt;p&gt;The tax comes due six months later. That is when a developer has to update the date format across the app. Instead of changing it in one place, they have to hunt down three different implementation methods. What should be a five-minute task turns into a two-hour headache.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bloat is the New Normal
&lt;/h2&gt;

&lt;p&gt;I recently looked at a simple "To-Do" app built by a founder using AI tools. It worked great. But the bundle size was massive.&lt;/p&gt;

&lt;p&gt;Why? Because every time the founder got stuck, they asked the AI for a fix, and the AI suggested installing a new library. Need a button? Install a UI kit. Need an icon? Install an icon pack. Need to center a div? Install a layout engine.&lt;/p&gt;

&lt;p&gt;The AI optimized for "getting it working now" rather than "keeping it lightweight." The result was a simple app carrying 50MB of dead weight. That is the Vibe Tax. You pay for it in server costs, slow load times, and frustrated users on mobile connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Market Impact: The "MVP" Trap
&lt;/h2&gt;

&lt;p&gt;This is where it affects the market. We are seeing a flood of MVPs (Minimum Viable Products) built entirely via vibe coding.&lt;/p&gt;

&lt;p&gt;Investors love them because they are built fast and cheap. But these products often have a technical lifespan of about three months.&lt;/p&gt;

&lt;p&gt;When these startups try to hire their first real engineering team to build "Version 2," the engineers take one look at the code and realize it is unsalvageable. There is no architecture. There is no security logic. It is just a loose pile of scripts held together by hope.&lt;/p&gt;

&lt;p&gt;The company then has to pause all feature development for months just to rewrite the entire thing. That is a massive tax.&lt;/p&gt;

&lt;h2&gt;
  
  
  Experience is the Only Audit
&lt;/h2&gt;

&lt;p&gt;This is why I believe the demand for senior engineers is actually going to go up, not down.&lt;/p&gt;

&lt;p&gt;Junior developers and non-coders can now generate volume. They can flood a repo with commits. But volume is not value.&lt;/p&gt;

&lt;p&gt;Companies are going to realize that while they can get features built for "free" with AI, the cost of maintaining that code is skyrocketing. They will need experienced eyes to look at a generated solution and say, "No, do not use that library," or "That database schema will fail at 1,000 users."&lt;/p&gt;

&lt;p&gt;The Vibe Tax is real. And the only way to avoid paying it is to stop treating AI as a magic wand and start treating it like what it actually is: a really fast, really confident intern who needs supervision.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>webdev</category>
      <category>vibecoding</category>
    </item>
    <item>
      <title>The New Digital Divide: Will "Vibe Coding" Really Make Everyone a Developer?</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 16:56:00 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/the-new-digital-divide-will-vibe-coding-really-make-everyone-a-developer-1961</link>
      <guid>https://dev.to/alikarbasicom/the-new-digital-divide-will-vibe-coding-really-make-everyone-a-developer-1961</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Nov 23, 2025&lt;/li&gt;
&lt;li&gt;4 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This post challenges the popular narrative that AI tools are making traditional coding skills obsolete by allowing anyone to become a software engineer. It argues that while "vibe coding" enables non-technical users to generate code quickly, it creates a new "digital divide" where these users become helpless "passengers" the moment they encounter complex errors or dependency conflicts. The article concludes that the market value of a developer is shifting from writing syntax to "logic verification," as the true cost of engineering lies in fixing systems when they break, not just generating them when they work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My LinkedIn feed is currently drowning in posts from "ex-non-technical" founders. You know the ones. They claim they built a SaaS in a weekend using nothing but Cursor and a dream. They say, "Coding is dead. English is the new programming language." And for a split second, I believe them.&lt;/p&gt;

&lt;p&gt;Then I look at the actual code they are shipping.&lt;/p&gt;

&lt;p&gt;We are being sold a story that AI is the great equalizer. The narrative is that the barrier to entry has dropped to zero, and now anyone with a keyboard is a software engineer. But I actually think the opposite is happening.&lt;/p&gt;

&lt;p&gt;Vibe coding isn't closing the digital divide. It is creating a much scarier one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Hello World" Mirage
&lt;/h2&gt;

&lt;p&gt;Here is the thing about coding that tutorials never tell you: writing the code is actually the easy part.&lt;/p&gt;

&lt;p&gt;If you ask an LLM to "build me a To-Do list app in React," it will do it. It will give you the component. It will give you the CSS. It looks great. The non-developer feels like a wizard.&lt;/p&gt;

&lt;p&gt;But then they try to run &lt;code&gt;npm install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Suddenly, they see a wall of red text. Something about peer dependency conflicts or a deprecated warning from a library the AI chose because its training data is six months old.&lt;/p&gt;

&lt;p&gt;This is the new divide.&lt;/p&gt;

&lt;p&gt;On one side, you have people who know how to read that error message, update the &lt;code&gt;package.json&lt;/code&gt;, and move on. On the other side, you have the "Vibe Coders" who are now completely stuck. They paste the error back into the AI. The AI apologizes and gives them a different wrong solution. They go in circles for four hours.&lt;/p&gt;

&lt;p&gt;Access to code generation is not the same thing as access to engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Passenger" Problem
&lt;/h2&gt;

&lt;p&gt;I like to think of it like self-driving cars.&lt;/p&gt;

&lt;p&gt;Vibe coding puts you in the driver's seat of a Tesla on Autopilot. It feels amazing. You are going 70 mph on the highway, listening to a podcast, barely touching the wheel. You feel like a driver.&lt;/p&gt;

&lt;p&gt;But what happens when the car suddenly swerves because it saw a ghost cone? Or when a tire blows out?&lt;/p&gt;

&lt;p&gt;If you don't know how to drive manually, you aren't a driver. You are a passenger who happens to be sitting in the front seat.&lt;/p&gt;

&lt;p&gt;The danger for these new "AI developers" is that they are building complex systems they do not understand. They are passengers in their own products. When a customer reports a bug, the Vibe Coder is helpless. They can't fix it because they never built it. They just asked for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The New Skill: Developing a "Lie Detector" for Code
&lt;/h2&gt;

&lt;p&gt;So, does this mean "normal people" can't become developers via AI?&lt;/p&gt;

&lt;p&gt;No, they absolutely can. But the path isn't just "typing prompts." The path is learning to audit what comes back.&lt;/p&gt;

&lt;p&gt;The most valuable skill for a junior developer right now isn't memorizing syntax. It is Logic Verification.&lt;/p&gt;

&lt;p&gt;I watched a junior dev use AI to write a regex for validating emails last week. The AI gave him a regex. It looked fancy. He pasted it in.&lt;/p&gt;

&lt;p&gt;I asked him, "Does that regex allow a plus sign for email aliases? Like &lt;code&gt;name+tag@gmail.com&lt;/code&gt;?"&lt;/p&gt;

&lt;p&gt;He didn't know. He hadn't checked. He trusted the vibe!&lt;/p&gt;

&lt;p&gt;Real development is now about looking at the AI's output and saying, "Nice try, but that is going to cause a memory leak." It is about having the foundational knowledge to know when the AI is hallucinating.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Verdict
&lt;/h2&gt;

&lt;p&gt;Vibe coding is an incredible entry point. It is like training wheels. It lets you feel the wind in your hair before you know how to balance.&lt;/p&gt;

&lt;p&gt;But if we tell people that the training wheels are the bike, we are setting them up for a nasty crash.&lt;/p&gt;

&lt;p&gt;The market doesn't pay you for the code you write when everything is going right. The market pays you for the code you fix when everything goes wrong. And unfortunately for the vibe coders, you can't prompt your way out of a system outage.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>vibecoding</category>
      <category>programming</category>
      <category>react</category>
    </item>
    <item>
      <title>Vibe Coding vs. System Architecture: Why "It Works" is Not the Same as "It Scales"</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 16:41:50 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/vibe-coding-vs-system-architecture-why-it-works-is-not-the-same-as-it-scales-3ibe</link>
      <guid>https://dev.to/alikarbasicom/vibe-coding-vs-system-architecture-why-it-works-is-not-the-same-as-it-scales-3ibe</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Nov 18, 2025&lt;/li&gt;
&lt;li&gt;2 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This piece distinguishes between the immediate gratification of "vibe coding" and the necessity of robust system architecture. It argues that while AI successfully handles the "happy path" for demos, it consistently overlooks critical factors like scalability, security, and edge cases, such as database connection limits or race conditions. Consequently, the role of the developer is evolving into that of an auditor who must validate AI outputs, ultimately ensuring job security as experts are required to stabilize fragile, AI-generated prototypes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I saw a tweet the other day. Maybe you saw it too. Someone "vibe coded" a Flappy Bird clone in like, forty-five seconds. They just typed "Make me a game with a bird that jumps," and boom. Python script. Working game.&lt;/p&gt;

&lt;p&gt;And honestly? It was impressive. I felt that familiar little pang of insecurity.&lt;/p&gt;

&lt;p&gt;Is this it? Am I done? Do I just retire to a goat farm now?&lt;/p&gt;

&lt;p&gt;But then I remembered the file my old boss sent me (the empty one I mentioned in my LinkedIn post). And I remembered what happens when you actually try to put that "forty-five second" code into a real production environment.&lt;/p&gt;

&lt;p&gt;The problem with Vibe Coding isn't that it doesn't work. It’s that "working" is the lowest bar in software engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Works on My Machine" Trap, AI Edition
&lt;/h2&gt;

&lt;p&gt;We’ve all been there. You write a quick script to parse a CSV. It runs fine on your laptop with 50 rows of data. Then you push it to prod, the client uploads a 4GB file, and the server melts because you loaded the whole thing into memory.&lt;/p&gt;

&lt;p&gt;AI is the king of the "happy path."&lt;/p&gt;

&lt;p&gt;When you tell an LLM, "Write me a React component that fetches user data" it will give you exactly that. A &lt;code&gt;useEffect&lt;/code&gt;, a &lt;code&gt;fetch&lt;/code&gt; call, maybe a loading state if it’s feeling generous. It works. You can click the button, and data appears. The vibe is good.&lt;/p&gt;

&lt;p&gt;But here is what the AI didn't ask you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What happens when the API is down? (The AI usually just lets the app crash).&lt;/li&gt;
&lt;li&gt;What about race conditions? If I click that button five times fast, do I trigger five parallel requests that return out of order?&lt;/li&gt;
&lt;li&gt;Where are the secrets stored? (I’ve seen AI hardcode API keys into frontend code more times than I can count).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vibe coding gets you from A to B. System architecture is asking, "What happens if 10,000 people try to go from A to B at the same time, and the road is on fire?"&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture is Invisible
&lt;/h2&gt;

&lt;p&gt;The reason "Vibe Coding" feels so magical to non-developers (and let's be real, to us too sometimes) is that code looks flat. To an LLM, a &lt;code&gt;for&lt;/code&gt; loop is just text. It predicts the next token. It doesn't "know" that a nested loop over a million records is a bad idea; it just knows that nested loops often appear in codebases.&lt;/p&gt;

&lt;p&gt;Architecture is the invisible structure that holds the code up. It's the decisions you make before you type.&lt;/p&gt;

&lt;p&gt;I recently reviewed some AI-generated backend code that "worked perfectly" for a single user. It opened a database connection, queried the data, and closed the connection. Great.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Except it opened a new connection for every single API request.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In a "vibe check," that passes. The app loads. The demo looks slick. But if you launched that? Your database runs out of connections in ten minutes, your site 504s, and you’re waking up at 3 AM wondering why the vibe has turned so hostile.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Developer as the Auditor
&lt;/h2&gt;

&lt;p&gt;This is where I think our role is actually going. We aren't just writers anymore; we’re auditors.&lt;/p&gt;

&lt;p&gt;When I use ChatGPT now, I don't treat it like a junior developer. I treat it like a talented but reckless contractor who lies on their resume.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Okay, you wrote the SQL query. Nice. Did you index that column?"&lt;/li&gt;
&lt;li&gt;"You added an image upload feature. Cool. Did you restrict the file types, or can someone upload a &lt;code&gt;.exe&lt;/code&gt; and hack the server?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The "Vibe" is fast, but it’s shallow. It prioritizes immediate gratification over long-term survival.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, Are We Doomed?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Nah.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If anything, "Vibe Coding" is going to create more work for us, not less. We are about to see a tsunami of "It Works!" prototypes hitting the market. These will be apps built entirely by prompt engineering that function beautifully until they hit their first edge case.&lt;/p&gt;

&lt;p&gt;Someone has to come in and untangle that spaghetti. Someone has to look at the "working" code and say, "Okay, this is cute, but it’s not scalable."&lt;/p&gt;

&lt;p&gt;That’s not vibe. That’s engineering.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>vibecoding</category>
      <category>career</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>How to Grayscale Images of Out-of-Stock Products in WooCommerce Using CSS</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 16:39:28 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/how-to-grayscale-images-of-out-of-stock-products-in-woocommerce-using-css-1a03</link>
      <guid>https://dev.to/alikarbasicom/how-to-grayscale-images-of-out-of-stock-products-in-woocommerce-using-css-1a03</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Aug 27, 2024&lt;/li&gt;
&lt;li&gt;2 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article provides a guide on how to enhance WooCommerce store navigation by automatically grayscaling images of out-of-stock products using CSS. By targeting the &lt;code&gt;.outofstock&lt;/code&gt; class that WooCommerce automatically assigns to unavailable items, store owners can apply a &lt;code&gt;filter: grayscale(1);&lt;/code&gt; rule to visually mute these specific images. This visual cue helps customers quickly identify stock availability without relying on text labels, and the necessary code can be easily implemented through the WordPress Theme Editor or the Customizer's Additional CSS section.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;WooCommerce is a powerful and flexible eCommerce plugin for WordPress, allowing you to create and manage an online store with ease. Making visual changes to your products, particularly those that are out of stock, using CSS is just one of the numerous ways you can personalize your WooCommerce store. This post will explain how to apply a simple CSS code snippet to grayscale product photos that are out of stock so that customers can notice that these items are not available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Grayscale Out-of-Stock Product Images?
&lt;/h2&gt;

&lt;p&gt;Grayscaling photos of out-of-stock products is a simple yet effective approach to notify shoppers that some things are now unavailable. This visual signal helps manage consumer expectations without requiring additional text or notifications. It also improves the customer experience by clearly indicating which products are in stock and which are not, decreasing frustration and improving the entire shopping experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  The CSS Code
&lt;/h2&gt;

&lt;p&gt;The CSS code required to grayscale the images of out-of-stock products in WooCommerce is simple and straightforward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.outofstock&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grayscale&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How This Code Works
&lt;/h2&gt;

&lt;p&gt;Let's break down how this code works and why it integrates seamlessly with WooCommerce:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WooCommerce's Built-In Class for Out-of-Stock Products:&lt;/strong&gt; WooCommerce automatically assigns the class &lt;code&gt;outofstock&lt;/code&gt; to products that are out of stock. This class can be targeted with CSS to apply specific styles to out-of-stock items only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Targeting the Product Image:&lt;/strong&gt; The &lt;code&gt;img&lt;/code&gt; selector within &lt;code&gt;.outofstock&lt;/code&gt; ensures that only the images of the out-of-stock products are affected by this CSS rule. This means that the rest of the product details, such as the title and price, will remain unchanged.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Applying the Grayscale Filter:&lt;/strong&gt; The &lt;code&gt;filter&lt;/code&gt; property in CSS is used to apply visual effects to elements. In this case, &lt;code&gt;grayscale(1)&lt;/code&gt; converts the image to black and white, with 1 indicating a full grayscale effect (as opposed to 0, which would leave the image in full color). This makes the product image appear muted, clearly signaling that the item is unavailable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implementing the Code in Your WooCommerce Store
&lt;/h2&gt;

&lt;p&gt;To apply this CSS code to your WooCommerce online store, you can simply add it to your theme's stylesheet or use the built-in Additional CSS option in the WordPress Customizer:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the Theme's Stylesheet:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your WordPress dashboard.&lt;/li&gt;
&lt;li&gt;Navigate to Appearance &amp;gt; Theme Editor.&lt;/li&gt;
&lt;li&gt;Locate the &lt;code&gt;style.css&lt;/code&gt; file of your active theme.&lt;/li&gt;
&lt;li&gt;Add the CSS code at the bottom of the file and save your changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Using the WordPress Customizer:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to your WordPress dashboard.&lt;/li&gt;
&lt;li&gt;Navigate to Appearance &amp;gt; Customize.&lt;/li&gt;
&lt;li&gt;Click on Additional CSS.&lt;/li&gt;
&lt;li&gt;Paste the CSS code into the text area and publish your changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Customizing your WooCommerce store to display grayscale out-of-stock product photos is a simple yet effective method to improve the user experience. Using WooCommerce's built-in classes and the CSS filter function, you can visually distinguish unavailable products, allowing customers to explore your store more efficiently. This little change can have a significant impact on how people perceive your store, resulting in a more enjoyable shopping experience.&lt;/p&gt;

&lt;p&gt;Feel free to play around with this CSS code and combine it with other styles to further customize your WooCommerce store!&lt;/p&gt;

&lt;p&gt;Happy Coding :D&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>css</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Boost Customer Loyalty with Automatic Discount Codes in WooCommerce</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 16:32:21 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/how-to-boost-customer-loyalty-with-automatic-discount-codes-in-woocommerce-5c86</link>
      <guid>https://dev.to/alikarbasicom/how-to-boost-customer-loyalty-with-automatic-discount-codes-in-woocommerce-5c86</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Aug 11, 2024&lt;/li&gt;
&lt;li&gt;2 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article outlines a technical method for increasing customer loyalty in WooCommerce by automatically generating unique discount codes for customers after they complete a purchase. By adding a specific PHP code snippet to the &lt;code&gt;functions.php&lt;/code&gt; file of a child theme, store owners can programmatically create a 25% off coupon that is linked to the customer's order ID and email, set to expire in 90 days. The guide highlights that this strategy not only personalizes the shopping experience but also incentivizes repeat business by providing a tangible reward for previous orders, ultimately serving as a low effort, high impact tool for customer retention.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Customer retention is critical for long-term business growth, and one efficient strategy to encourage repeat purchases is to provide discount codes for future sales. This article will explore how to use automatic discount code generation in WooCommerce to enhance client loyalty and sales.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing Automatic Discount Codes
&lt;/h2&gt;

&lt;p&gt;Adding automatic discount codes to your WooCommerce online store is a straightforward process. By inserting the following code into your theme’s &lt;code&gt;functions.php&lt;/code&gt; file, you can automatically generate a unique discount code when a customer completes a purchase. This code can then be used by the customer on their next order.&lt;/p&gt;

&lt;p&gt;Here’s the code to achieve this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/**
 * Automatic Discount Codes in WooCommerce
 * Visit alikarbasi.com/blog for more codes.
**/&lt;/span&gt;

&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'woocommerce_order_status_processing'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'create_discount_code_with_order_id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;create_discount_code_with_order_id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;wc_get_order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order_id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nv"&gt;$email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$order&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get_billing_email&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// Order number with "solo" prefix as discount code&lt;/span&gt;
    &lt;span class="nv"&gt;$coupon_code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'solo'&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$order_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// Discount percentage&lt;/span&gt;
    &lt;span class="nv"&gt;$amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'25'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// Discount type&lt;/span&gt;
    &lt;span class="nv"&gt;$discount_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'percent'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Check if the discount code with this order number and prefix already exists&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;get_page_by_title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$coupon_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;OBJECT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'shop_coupon'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nv"&gt;$coupon&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s1"&gt;'post_title'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$coupon_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'post_content'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'post_status'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'publish'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'post_author'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'post_type'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'shop_coupon'&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;wp_insert_post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$coupon&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Discount code settings&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'discount_type'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$discount_type&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'coupon_amount'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'individual_use'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'yes'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'usage_limit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;//Set discount code to expire after 3 months&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'expiry_date'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Y-m-d'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;strtotime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'+90 days'&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'customer_email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$email&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'usage_limit_per_user'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'minimum_amount'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'50'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$new_coupon_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'product_ids'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Save the discount code as order meta data for future use&lt;/span&gt;
    &lt;span class="nf"&gt;update_post_meta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'_discount_coupon_code'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$coupon_code&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benefits of Automatic Discount Codes
&lt;/h2&gt;

&lt;p&gt;Giving consumers a discount code for subsequent purchases encourages them to stay loyal to your business. This may be a crucial tactic in preserving enduring connections with your clients.&lt;/p&gt;

&lt;p&gt;Having automatic discount codes makes buying more personalized for the individual. Consumers like the gesture of a discount since it makes them feel important and may improve their opinion of your brand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices for Implementation
&lt;/h2&gt;

&lt;p&gt;When implementing this feature, it is advisable to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use a Child Theme:&lt;/strong&gt; Insert the code into your theme’s child theme rather than the main theme. This ensures that your changes are preserved even after theme updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customize Messaging:&lt;/strong&gt; Tailor the discount code message sent to customers to align with your brand’s tone and enhance their experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Using WooCommerce to automatically generate discount codes is a straightforward but powerful way to increase sales and foster client loyalty. You can quickly add this feature to your WordPress website and give your consumers an extra reason to come back and make more purchases by following the above-described procedures. This minor adjustment can have a big impact on customer retention and overall company expansion.&lt;/p&gt;

&lt;p&gt;Happy coding :D&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>woocommerce</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Hide Out-of-Stock Products on Your WordPress Website</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 16:25:24 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/how-to-hide-out-of-stock-products-on-your-wordpress-website-4ajm</link>
      <guid>https://dev.to/alikarbasicom/how-to-hide-out-of-stock-products-on-your-wordpress-website-4ajm</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Aug 5, 2024&lt;/li&gt;
&lt;li&gt;2 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article outlines a technical method to improve the shopping experience on WordPress websites by automatically hiding out-of-stock products from the main views. By adding a custom PHP code snippet to the theme's &lt;code&gt;functions.php&lt;/code&gt; file, site administrators can utilize the &lt;code&gt;pre_get_posts&lt;/code&gt; action hook to modify the main database query. This ensures that items with a "outofstock" status are excluded from the home page, shop page, and product category archives, keeping the storefront clutter-free and preventing customer frustration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you use WordPress to manage an online store, you must keep your product pages clean and clutter-free. One effective strategy is to hide out-of-stock items. This improves the general shopping experience and helps avoid confusion among customers. In this article, we'll walk you through a simple method to hide out-of-stock products using a custom code snippet added to your &lt;code&gt;functions.php&lt;/code&gt; file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Code
&lt;/h2&gt;

&lt;p&gt;Let's start by looking at the code that will make your product pages show only available products.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/**
 * Visit alikarbasi.com/blog for more codes.
**/&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;custom_pre_get_posts_query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nv"&gt;$q&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nf"&gt;is_admin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$q&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;is_main_query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nf"&gt;is_home&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;is_front_page&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;is_shop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;is_product_category&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nv"&gt;$meta_query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$q&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'meta_query'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nv"&gt;$meta_query&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s1"&gt;'key'&lt;/span&gt;     &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'_stock_status'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'value'&lt;/span&gt;   &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'outofstock'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s1"&gt;'compare'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'NOT IN'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nv"&gt;$q&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'meta_query'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$meta_query&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'pre_get_posts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'custom_pre_get_posts_query'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;This code snippet leverages the &lt;code&gt;pre_get_posts&lt;/code&gt; action hook to modify the main query before WordPress fetches posts from the database. Here's a breakdown of how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Function Declaration:&lt;/strong&gt; The function &lt;code&gt;custom_pre_get_posts_query&lt;/code&gt; is declared to modify the query parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conditional Check:&lt;/strong&gt; The function checks if the current request is not from the WordPress admin area (&lt;code&gt;! is_admin()&lt;/code&gt;) and if it is the main query (&lt;code&gt;$q-&amp;gt;is_main_query()&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Home and Front Page Check:&lt;/strong&gt; It further checks if the current page is the home page or the front page (&lt;code&gt;is_home()&lt;/code&gt; or &lt;code&gt;is_front_page()&lt;/code&gt;) or the current page is shop page (&lt;code&gt;is_shop()&lt;/code&gt;) or product category page (&lt;code&gt;is_product_category()&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modify Meta Query:&lt;/strong&gt; If all conditions are met, it retrieves the existing &lt;code&gt;meta_query&lt;/code&gt; from the query object and appends a new condition to exclude posts with the meta key &lt;code&gt;_stock_status&lt;/code&gt; set to &lt;code&gt;outofstock&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set Modified Meta Query:&lt;/strong&gt; The modified &lt;code&gt;meta_query&lt;/code&gt; is then set back to the query object, effectively excluding out-of-stock products from the results.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to Use the Code
&lt;/h2&gt;

&lt;p&gt;To apply this code to your WordPress site, take these steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Access Your Theme's &lt;code&gt;functions.php&lt;/code&gt; File:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your WordPress admin dashboard.&lt;/li&gt;
&lt;li&gt;Navigate to Appearance &amp;gt; Theme Editor.&lt;/li&gt;
&lt;li&gt;In the Theme Files list, locate and click on &lt;code&gt;functions.php&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Add the Code:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy the provided code snippet.&lt;/li&gt;
&lt;li&gt;Paste it at the end of your &lt;code&gt;functions.php&lt;/code&gt; file, just before the closing &lt;code&gt;?&amp;gt;&lt;/code&gt; tag if it exists.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Save Changes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the Update File button to save your changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By adding this simple code snippet in your &lt;code&gt;functions.php&lt;/code&gt; file, you can easily hide out-of-stock items from your product and main pages. This will assist maintain your website clean and guarantee that customers only see available products.&lt;/p&gt;

&lt;p&gt;Happy coding :D&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>beginners</category>
      <category>php</category>
    </item>
    <item>
      <title>The Easiest Way to Add Dark Mode to Your Website</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 16:23:17 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/the-easiest-way-to-add-dark-mode-to-your-website-29c4</link>
      <guid>https://dev.to/alikarbasicom/the-easiest-way-to-add-dark-mode-to-your-website-29c4</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Jul 28, 2024&lt;/li&gt;
&lt;li&gt;3 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This tutorial outlines a method for implementing dark mode on a website using HTML, CSS variables, and JavaScript. The process involves creating a basic HTML structure with a toggle button, defining specific color variables for both light and dark themes in CSS, and using JavaScript to switch the "dark-mode" class while saving the user's preference in local storage. By following these steps, developers can ensure a seamless transition between themes that persists across page reloads, ultimately improving user experience by reducing eye strain and conserving battery life.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The ability to use websites and applications in dark mode has grown in popularity in recent years. It relieves eye strain, prolongs battery life on OLED-screening devices, and offers an aesthetically pleasing substitute for the traditional light theme. This tutorial will show you how to use JavaScript to toggle themes and CSS variables to add dark mode to your website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Setting Up Your HTML
&lt;/h2&gt;

&lt;p&gt;First, let's start with a basic HTML structure. Create an &lt;code&gt;index.html&lt;/code&gt; file with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Dark Mode Example&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"styles.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Welcome to Dark Mode Tutorial&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"theme-toggle"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Toggle Dark Mode&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is a sample website to demonstrate dark mode implementation.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"script.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This HTML file includes a header with a title and a button to toggle dark mode, a main content area with some text, and links to our CSS and JavaScript files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Defining CSS Variables
&lt;/h2&gt;

&lt;p&gt;Now let's define the variables in our CSS. Make a &lt;code&gt;styles.css&lt;/code&gt; file with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--header-background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f1f1f1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--background-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Arial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;background-color&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--header-background-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.dark-mode&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#181818&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--text-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--header-background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#242424&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We use &lt;code&gt;:root&lt;/code&gt; to define a group of CSS variables in this CSS file. For the light mode, these variables determine the background color, text color, and header background color. Additionally, a &lt;code&gt;.dark-mode&lt;/code&gt; class is defined, and its settings take precedence over these variables. A seamless transition between themes is guaranteed by the body element's transition property.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Adding JavaScript for Theme Toggling
&lt;/h2&gt;

&lt;p&gt;Now, let's add the JavaScript to handle the theme toggling. Create a &lt;code&gt;script.js&lt;/code&gt; file with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;themeToggle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme-toggle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Check for saved user preference&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;savedTheme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;savedTheme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;savedTheme&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Toggle dark mode&lt;/span&gt;
&lt;span class="nx"&gt;themeToggle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toggle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark-mode&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Save user preference&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark-mode&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark-mode&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;removeItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script selects the theme toggle button and the body element. When the button is clicked, it toggles the &lt;code&gt;dark-mode&lt;/code&gt; class on the body. The script also saves the user's theme preference in &lt;code&gt;localStorage&lt;/code&gt;, so the theme persists across page reloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Testing the Implementation
&lt;/h2&gt;

&lt;p&gt;Launch your web browser and open the &lt;code&gt;index.html&lt;/code&gt; file to test the implementation. To switch between bright and dark themes, click the "Toggle Dark Mode" button. Remember that refreshing the page shouldn't affect the theme preference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can quickly add a dark mode toggle to your website by utilizing CSS variables and a little JavaScript. This methodology facilitates seamless theme transitions and offers an enhanced user experience. Please feel free to add more elements to your page and modify the styles in order to build upon this lesson.&lt;/p&gt;

&lt;p&gt;Happy coding :D&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>darkmode</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Checking Internet Status in Basic4Android</title>
      <dc:creator>Ali Karbasi</dc:creator>
      <pubDate>Tue, 26 May 2026 16:08:04 +0000</pubDate>
      <link>https://dev.to/alikarbasicom/checking-internet-status-in-basic4android-3j5j</link>
      <guid>https://dev.to/alikarbasicom/checking-internet-status-in-basic4android-3j5j</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Posted on Jul 29, 2023&lt;/li&gt;
&lt;li&gt;1 min read&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;🤖 AI summary: This article outlines a method for preventing default error messages in Basic4Android WebViews by verifying internet connectivity before loading content. By utilizing the &lt;code&gt;Network&lt;/code&gt; library and initializing a &lt;code&gt;ServerSocket&lt;/code&gt; on port 0, developers can implement a subroutine that checks the device's IP address. If the returned IP is "127.0.0.1", the device is considered offline, while any other IP indicates an active connection. This boolean check allows the application to gracefully handle offline states by displaying custom messages or hiding the WebView instead of showing standard browser errors.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Basic4Android lets you use WebView to load URLs in your application, but if your phone isn’t connected to the internet when the program runs, an error message will show up in the WebView itself, which doesn’t look nice.&lt;/p&gt;

&lt;p&gt;By using this piece of code, you can check if the user’s phone is connected to the internet or not. Depending on the information you get, you can either hide the WebView or display an error message. Of course, this code can have other applications as well, but in this post, I’m using it for this purpose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Required libraries:&lt;/strong&gt; &lt;code&gt;Network&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;First you need to define a &lt;code&gt;ServerSocket&lt;/code&gt; variable in &lt;code&gt;Process_Globals&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="k"&gt;Sub&lt;/span&gt; &lt;span class="nf"&gt;Process_Globals&lt;/span&gt;
    &lt;span class="k"&gt;Dim&lt;/span&gt; &lt;span class="nv"&gt;server&lt;/span&gt; &lt;span class="ow"&gt;As&lt;/span&gt; &lt;span class="n"&gt;ServerSocket&lt;/span&gt;
&lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, check the phone’s IP address using the following Sub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="k"&gt;Sub&lt;/span&gt; &lt;span class="nf"&gt;GetIp&lt;/span&gt; &lt;span class="ow"&gt;As&lt;/span&gt; &lt;span class="kt"&gt;Boolean&lt;/span&gt;
    &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;If&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetMyIP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"127.0.0.1"&lt;/span&gt; &lt;span class="k"&gt;Then&lt;/span&gt;
      &lt;span class="k"&gt;Return&lt;/span&gt; &lt;span class="k"&gt;False&lt;/span&gt;
    &lt;span class="k"&gt;Else&lt;/span&gt;
      &lt;span class="k"&gt;Return&lt;/span&gt; &lt;span class="k"&gt;True&lt;/span&gt;
    &lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;If&lt;/span&gt;
&lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;Sub&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you know, if we’re not connected to the internet, the default IP address of the device is &lt;code&gt;127.0.0.1&lt;/code&gt;. The &lt;code&gt;If&lt;/code&gt; condition checks this IP and returns &lt;code&gt;False&lt;/code&gt; if the phone’s IP matches &lt;code&gt;127.0.0.1&lt;/code&gt; and if the IP address is not &lt;code&gt;127.0.0.1&lt;/code&gt; (meaning we are connected to the internet), it returns &lt;code&gt;True&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;By the way, the number &lt;code&gt;0&lt;/code&gt; in &lt;code&gt;server.Initialize(0,"")&lt;/code&gt; represents the port number. &lt;a href="https://www.b4x.com/android/help/network.html" rel="noopener noreferrer"&gt;More Info&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last but not least, you can use the &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt; value to check if the internet connection is working:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vb"&gt;&lt;code&gt;&lt;span class="k"&gt;If&lt;/span&gt; &lt;span class="n"&gt;GetIp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;True&lt;/span&gt; &lt;span class="k"&gt;Then&lt;/span&gt;
  &lt;span class="n"&gt;ToastMessageShow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Internet connection is established."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;Else&lt;/span&gt;
  &lt;span class="n"&gt;ToastMessageShow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"No internet connection!"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;False&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;End&lt;/span&gt; &lt;span class="k"&gt;If&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s all!&lt;/p&gt;

&lt;p&gt;Happy coding :D&lt;/p&gt;

</description>
      <category>android</category>
      <category>basic4android</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
