<?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: Muhammad Medhat</title>
    <description>The latest articles on DEV Community by Muhammad Medhat (@muhammadmedhat).</description>
    <link>https://dev.to/muhammadmedhat</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F902861%2F6b74e488-ba5e-4a22-bff1-907795830f32.jpeg</url>
      <title>DEV Community: Muhammad Medhat</title>
      <link>https://dev.to/muhammadmedhat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muhammadmedhat"/>
    <language>en</language>
    <item>
      <title>WordPress Heartbeat API: The Hidden Requests That Can Slow Down Your Website</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Sat, 21 Nov 2026 22:42:33 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/wordpress-heartbeat-api-the-hidden-requests-that-can-slow-down-your-website-3oi8</link>
      <guid>https://dev.to/muhammadmedhat/wordpress-heartbeat-api-the-hidden-requests-that-can-slow-down-your-website-3oi8</guid>
      <description>&lt;p&gt;When troubleshooting a slow WordPress website, most developers start by checking plugins, themes, caching, and database queries.&lt;/p&gt;

&lt;p&gt;But have you ever considered that WordPress itself might be generating repeated background requests?&lt;/p&gt;

&lt;p&gt;That's exactly what I discovered while investigating a client's website.&lt;/p&gt;

&lt;p&gt;In my &lt;a href="https://dev.to/muhammadmedhat/my-wordpress-site-was-slow-so-i-stopped-installing-more-plugins-2fko"&gt;previous article&lt;/a&gt;, I shared how a client's WordPress website had numerous plugins installed and was experiencing performance problems.&lt;/p&gt;

&lt;p&gt;During my investigation, I contacted the hosting provider's support team and asked them to examine the server logs.&lt;/p&gt;

&lt;p&gt;Their response surprised me.&lt;/p&gt;

&lt;p&gt;They reported a massive number of requests associated with something called the &lt;strong&gt;WordPress Heartbeat API&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At the time, I wasn't familiar with Heartbeat or how it worked.&lt;/p&gt;

&lt;p&gt;So I started researching it.&lt;/p&gt;

&lt;p&gt;What I discovered was an important WordPress feature that many developers use indirectly without realizing it.&lt;/p&gt;

&lt;p&gt;In this article, I'll explain what the WordPress Heartbeat API is, how it works, when it can affect performance, and how to investigate and control it safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Is the WordPress Heartbeat API?
&lt;/h2&gt;

&lt;p&gt;The WordPress Heartbeat API is a built-in feature introduced in WordPress 3.6.&lt;/p&gt;

&lt;p&gt;It allows communication between the user's browser and the WordPress server at regular intervals without requiring a full page reload.&lt;/p&gt;

&lt;p&gt;This communication uses AJAX requests.&lt;/p&gt;

&lt;p&gt;Heartbeat supports several important WordPress features, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Post locking:&lt;/strong&gt; Prevents multiple users from editing the same post simultaneously.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Autosave-related functionality:&lt;/strong&gt; Helps the editor communicate with WordPress while content is being edited.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session monitoring:&lt;/strong&gt; Helps WordPress detect authentication-related changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plugin functionality:&lt;/strong&gt; Allows plugins to exchange information with the server periodically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, imagine two authors working on the same WordPress website.&lt;/p&gt;

&lt;p&gt;When one author starts editing a post, WordPress can notify the second author that the post is already being edited.&lt;/p&gt;

&lt;p&gt;Heartbeat helps make that communication possible.&lt;/p&gt;

&lt;p&gt;It's a useful feature, but it also creates server requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How Does WordPress Heartbeat Work?
&lt;/h2&gt;

&lt;p&gt;Heartbeat uses JavaScript on the browser side and PHP on the server side.&lt;/p&gt;

&lt;p&gt;The process is relatively straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A user opens a WordPress administration page.&lt;/li&gt;
&lt;li&gt;WordPress loads the Heartbeat JavaScript functionality where it is enabled.&lt;/li&gt;
&lt;li&gt;JavaScript periodically sends an AJAX request to the server.&lt;/li&gt;
&lt;li&gt;WordPress processes the request.&lt;/li&gt;
&lt;li&gt;The server returns a response.&lt;/li&gt;
&lt;li&gt;The process repeats while the relevant page remains active.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These requests commonly use the following endpoint:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/wp-admin/admin-ajax.php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;POST&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;wp&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ajax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request typically includes an action parameter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;action=heartbeat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important detail is that &lt;code&gt;admin-ajax.php&lt;/code&gt; is not exclusive to Heartbeat.&lt;/p&gt;

&lt;p&gt;Many WordPress plugins and themes also use this endpoint for their own AJAX operations.&lt;/p&gt;

&lt;p&gt;Therefore, seeing requests to &lt;code&gt;admin-ajax.php&lt;/code&gt; doesn't automatically mean Heartbeat is responsible.&lt;/p&gt;

&lt;p&gt;You need to inspect the request payload to identify the action.&lt;/p&gt;

&lt;h3&gt;
  
  
  How frequently does Heartbeat run?
&lt;/h3&gt;

&lt;p&gt;Heartbeat uses a configurable interval that varies depending on the WordPress context and activity.&lt;/p&gt;

&lt;p&gt;A commonly used default interval is around 15 seconds, although actual behavior can differ between screens and configurations.&lt;/p&gt;

&lt;p&gt;Heartbeat can also slow its polling when browser activity changes.&lt;/p&gt;

&lt;p&gt;This means it isn't necessarily sending requests at a fixed rate under every condition.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why Can Heartbeat Affect Website Performance?
&lt;/h2&gt;

&lt;p&gt;A single Heartbeat request usually isn't a problem.&lt;/p&gt;

&lt;p&gt;The concern arises when many requests are generated or when processing them becomes expensive.&lt;/p&gt;

&lt;p&gt;Consider a simplified example.&lt;/p&gt;

&lt;p&gt;Suppose Heartbeat sends one request every 15 seconds.&lt;/p&gt;

&lt;p&gt;That means approximately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4 requests per minute
240 requests per hour
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now imagine 10 users have WordPress administration pages open simultaneously.&lt;/p&gt;

&lt;p&gt;Under those simplified assumptions, the site could receive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;40 requests per minute
2,400 requests per hour
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are illustrative calculations, not measurements from my client's website. Actual request counts depend on browser activity, WordPress configuration, and other factors.&lt;/p&gt;

&lt;p&gt;Each request may require PHP processing and could trigger additional plugin callbacks.&lt;/p&gt;

&lt;p&gt;On a server with limited resources, excessive or expensive requests can contribute to performance problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple open browser tabs
&lt;/h3&gt;

&lt;p&gt;An administrator might have several WordPress dashboard tabs open.&lt;/p&gt;

&lt;p&gt;If Heartbeat is active in multiple tabs, each may generate periodic requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Plugins using Heartbeat
&lt;/h3&gt;

&lt;p&gt;Some plugins extend Heartbeat with their own functionality.&lt;/p&gt;

&lt;p&gt;Poorly optimized callbacks can increase the amount of processing performed during a Heartbeat request.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limited hosting resources
&lt;/h3&gt;

&lt;p&gt;On hosting environments with constrained CPU or PHP worker capacity, background requests can compete with other requests for resources.&lt;/p&gt;

&lt;p&gt;However, Heartbeat requests alone don't prove the cause of a performance issue.&lt;/p&gt;

&lt;p&gt;They are a signal worth investigating.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. How to Identify Heartbeat Requests
&lt;/h2&gt;

&lt;p&gt;You don't necessarily need a performance plugin to inspect Heartbeat activity.&lt;/p&gt;

&lt;p&gt;Your browser's developer tools are a useful starting point.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Open WordPress Admin
&lt;/h3&gt;

&lt;p&gt;Log in to your WordPress dashboard and open a page where Heartbeat is active, such as the post editor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Open Developer Tools
&lt;/h3&gt;

&lt;p&gt;In Chrome or Firefox, press:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;F12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to the &lt;strong&gt;Network&lt;/strong&gt; tab.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Filter AJAX Requests
&lt;/h3&gt;

&lt;p&gt;Select the Fetch/XHR filter.&lt;/p&gt;

&lt;p&gt;Look for requests to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;admin-ajax.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Leave the page open long enough to observe whether requests repeat.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Inspect the Request
&lt;/h3&gt;

&lt;p&gt;Click a request and inspect its payload.&lt;/p&gt;

&lt;p&gt;Look for:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;action: heartbeat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see that action, you've identified a Heartbeat request.&lt;/p&gt;

&lt;p&gt;You can also inspect the request's timing and response.&lt;/p&gt;

&lt;p&gt;Remember that the total request duration isn't the same as PHP execution time, and a slow request doesn't necessarily mean Heartbeat itself is inefficient.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Check Server Logs
&lt;/h3&gt;

&lt;p&gt;Browser DevTools show requests from your own browser session.&lt;/p&gt;

&lt;p&gt;Server logs can help reveal request patterns across the website.&lt;/p&gt;

&lt;p&gt;You can ask your hosting provider to investigate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The number of requests to &lt;code&gt;admin-ajax.php&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;How many of those requests are associated with Heartbeat.&lt;/li&gt;
&lt;li&gt;Whether requests correlate with CPU or memory spikes.&lt;/li&gt;
&lt;li&gt;Whether specific PHP processes or plugin callbacks are expensive.&lt;/li&gt;
&lt;li&gt;Whether the requests coincide with the reported performance problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is exactly why contacting hosting support was valuable in my client's case.&lt;/p&gt;

&lt;p&gt;The logs gave me a technical lead that wasn't obvious from looking at the website.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. How to Control WordPress Heartbeat Safely
&lt;/h2&gt;

&lt;p&gt;Once you've confirmed that Heartbeat activity deserves investigation, you can consider adjusting its behavior.&lt;/p&gt;

&lt;p&gt;However, I wouldn't recommend disabling it globally as a first step.&lt;/p&gt;

&lt;p&gt;Heartbeat supports useful functionality, and changing it can affect the editing experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Adjust the Heartbeat Interval
&lt;/h3&gt;

&lt;p&gt;WordPress provides the &lt;code&gt;heartbeat_settings&lt;/code&gt; filter, which lets developers modify Heartbeat settings.&lt;/p&gt;

&lt;p&gt;For example:&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_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'heartbeat_settings'&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;$settings&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$settings&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'interval'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&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;$settings&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;p&gt;This example sets the polling interval to 60 seconds.&lt;/p&gt;

&lt;p&gt;You can place the code in a small custom plugin or another appropriate location where your WordPress customizations are managed.&lt;/p&gt;

&lt;p&gt;The interval is subject to WordPress's supported limits, and the effective polling behavior may vary depending on the page and activity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Increasing the interval reduces polling frequency, but it also means Heartbeat-dependent updates may take longer.&lt;/p&gt;

&lt;p&gt;Always test the affected functionality.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Adjust Heartbeat Only on Selected Screens
&lt;/h3&gt;

&lt;p&gt;Rather than changing the interval everywhere, you can apply a different setting on a particular administration screen.&lt;/p&gt;

&lt;p&gt;For example:&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_filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'heartbeat_settings'&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;$settings&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="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;return&lt;/span&gt; &lt;span class="nv"&gt;$settings&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nv"&gt;$screen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_current_screen&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="nv"&gt;$screen&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="s1"&gt;'dashboard'&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nv"&gt;$screen&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;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;$settings&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'interval'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&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;$settings&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;p&gt;This example targets the main WordPress dashboard screen.&lt;/p&gt;

&lt;p&gt;It doesn't globally disable Heartbeat or change the post editor's interval.&lt;/p&gt;

&lt;p&gt;Screen-specific changes can be preferable when you've identified a particular area that needs adjustment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 3: Disable Heartbeat on a Specific Screen
&lt;/h3&gt;

&lt;p&gt;WordPress also provides a way to dequeue scripts.&lt;/p&gt;

&lt;p&gt;For example:&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;'admin_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="nv"&gt;$hook&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="s1"&gt;'index.php'&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nv"&gt;$hook&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_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'heartbeat'&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="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&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 example attempts to remove Heartbeat from the main dashboard page.&lt;/p&gt;

&lt;p&gt;It should only be used after confirming that no required functionality on that screen depends on Heartbeat.&lt;/p&gt;

&lt;p&gt;I would avoid disabling Heartbeat throughout the administration area, especially in the post editor, without understanding the consequences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My preference is to investigate and make targeted adjustments rather than disabling core functionality blindly.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. How to Verify Your Changes
&lt;/h2&gt;

&lt;p&gt;After changing Heartbeat settings, return to the browser's Network tab.&lt;/p&gt;

&lt;p&gt;Check whether the frequency of Heartbeat requests has changed as expected.&lt;/p&gt;

&lt;p&gt;Then test important WordPress functionality.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the post editor.&lt;/li&gt;
&lt;li&gt;Check whether editing and autosaving behave correctly.&lt;/li&gt;
&lt;li&gt;Test post locking with another user account, if available.&lt;/li&gt;
&lt;li&gt;Verify that any plugin functionality relying on Heartbeat still works.&lt;/li&gt;
&lt;li&gt;Review server resource usage and logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ideally, compare measurements before and after the change under similar conditions.&lt;/p&gt;

&lt;p&gt;If you have access to server monitoring, look at PHP worker utilization, CPU activity, and request volume.&lt;/p&gt;

&lt;p&gt;A reduction in Heartbeat requests doesn't automatically prove that the website became faster.&lt;/p&gt;

&lt;p&gt;The objective is to determine whether the change improved the original problem without introducing new issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What I Learned from This Experience
&lt;/h2&gt;

&lt;p&gt;When the hosting provider first mentioned WordPress Heartbeat, I didn't know much about it.&lt;/p&gt;

&lt;p&gt;I had worked with WordPress for years, but this particular feature wasn't something I had previously needed to investigate in detail.&lt;/p&gt;

&lt;p&gt;The experience reminded me of three important lessons.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Server logs can reveal problems you don't see in the browser
&lt;/h3&gt;

&lt;p&gt;Looking at the website's frontend doesn't always reveal what is happening on the server.&lt;/p&gt;

&lt;p&gt;Logs and resource metrics can provide valuable evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Not every performance issue requires another plugin
&lt;/h3&gt;

&lt;p&gt;Plugins can be useful, but adding one without understanding the problem can make the setup more complicated.&lt;/p&gt;

&lt;p&gt;Sometimes WordPress already provides the hooks and tools needed to investigate or adjust a feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Good developers don't need to know everything
&lt;/h3&gt;

&lt;p&gt;What matters is the ability to investigate unfamiliar behavior, understand the underlying system, and evaluate possible solutions.&lt;/p&gt;

&lt;p&gt;In my case, a real client problem motivated me to learn about a WordPress feature I hadn't previously explored.&lt;/p&gt;

&lt;p&gt;And that knowledge became useful beyond the original project.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Heartbeat vs. WP-Cron: Are They the Same?
&lt;/h2&gt;

&lt;p&gt;One final point worth mentioning is that Heartbeat and WP-Cron are different mechanisms.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Heartbeat API&lt;/th&gt;
&lt;th&gt;WP-Cron&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Purpose&lt;/td&gt;
&lt;td&gt;Periodic browser–server communication&lt;/td&gt;
&lt;td&gt;Scheduled WordPress tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical trigger&lt;/td&gt;
&lt;td&gt;Browser-side JavaScript&lt;/td&gt;
&lt;td&gt;WordPress's cron spawning mechanism&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Common endpoint&lt;/td&gt;
&lt;td&gt;&lt;code&gt;admin-ajax.php&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;wp-cron.php&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Example use&lt;/td&gt;
&lt;td&gt;Post locking&lt;/td&gt;
&lt;td&gt;Scheduled publishing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance concern&lt;/td&gt;
&lt;td&gt;Excessive or expensive AJAX requests&lt;/td&gt;
&lt;td&gt;Excessive, delayed, or expensive scheduled tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both are worth understanding when troubleshooting WordPress performance, but they should not be confused.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In my next article, I'll explore WP-Cron in more detail&lt;/strong&gt;, including how it works, why scheduled tasks sometimes fail or run late, and when using a real server cron job can be useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The WordPress Heartbeat API is not a bug or an unnecessary feature.&lt;/p&gt;

&lt;p&gt;It provides useful functionality that helps WordPress deliver a better editing and administration experience.&lt;/p&gt;

&lt;p&gt;However, like any server-side activity, it can contribute to performance problems under certain conditions.&lt;/p&gt;

&lt;p&gt;The key is understanding how it works, measuring its impact, and making changes only when the evidence supports them.&lt;/p&gt;

&lt;p&gt;My experience with a client's website taught me that troubleshooting isn't always about finding a new tool.&lt;/p&gt;

&lt;p&gt;Sometimes it's about discovering a feature you didn't know existed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before disabling Heartbeat or installing another optimization plugin, investigate the requests and understand what's actually happening.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;I'm a WordPress developer specializing in custom WordPress development, WooCommerce, PHP, and JavaScript.&lt;/p&gt;

&lt;p&gt;You can explore my work on &lt;a href="https://github.com/muhammad-medhat" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you've encountered excessive Heartbeat requests on a WordPress website, I'd be interested to hear how you investigated them.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have you ever discovered an unexpected WordPress feature while troubleshooting a client project?&lt;/em&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>performance</category>
      <category>php</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>My WordPress Site Was Slow — So I Stopped Installing More Plugins</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Thu, 29 Oct 2026 14:35:46 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/my-wordpress-site-was-slow-so-i-stopped-installing-more-plugins-2fko</link>
      <guid>https://dev.to/muhammadmedhat/my-wordpress-site-was-slow-so-i-stopped-installing-more-plugins-2fko</guid>
      <description>&lt;p&gt;When a WordPress website becomes slow or unstable, installing another optimization plugin might seem like the easiest solution.&lt;/p&gt;

&lt;p&gt;A caching plugin, a database optimizer, an image optimization tool, or another performance solution might seem like the answer.&lt;/p&gt;

&lt;p&gt;But sometimes, the real problem is hidden in the existing setup.&lt;/p&gt;

&lt;p&gt;I once worked with a client whose WordPress website had a large number of plugins installed. Instead of immediately adding another optimization plugin, I decided to investigate what was happening behind the scenes.&lt;/p&gt;

&lt;p&gt;What I discovered taught me an important lesson about WordPress performance: &lt;strong&gt;you don't always need another plugin. Sometimes, you need to understand WordPress itself a little better.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start by investigating the problem
&lt;/h2&gt;

&lt;p&gt;When troubleshooting a website, I try not to jump to conclusions.&lt;/p&gt;

&lt;p&gt;A slow website can have many possible causes, including inefficient plugins, expensive database queries, unoptimized images, caching problems, or limited server resources.&lt;/p&gt;

&lt;p&gt;In my client's case, the website had many plugins, so I wanted to understand whether something in the existing setup was contributing to the problem.&lt;/p&gt;

&lt;p&gt;Rather than randomly disabling plugins or installing more optimization tools, I contacted the hosting provider's customer support and requested the website logs.&lt;/p&gt;

&lt;p&gt;Their response pointed me in a direction I hadn't expected.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. An unexpected discovery: WordPress Heartbeat
&lt;/h2&gt;

&lt;p&gt;The hosting support team informed me that the website was generating a massive number of requests associated with WordPress Heartbeat.&lt;/p&gt;

&lt;p&gt;At that time, I wasn't very familiar with Heartbeat or how it worked internally.&lt;/p&gt;

&lt;p&gt;Instead of immediately disabling it, I decided to read about it and understand its purpose.&lt;/p&gt;

&lt;p&gt;WordPress Heartbeat is a built-in API that allows the browser and the WordPress server to communicate periodically. It supports features such as post locking, autosaving in the editor, and other functionality that requires periodic communication.&lt;/p&gt;

&lt;p&gt;These requests are normal. However, depending on the configuration, plugins, usage patterns, and hosting environment, frequent requests can contribute to server workload.&lt;/p&gt;

&lt;p&gt;The important lesson for me was that &lt;strong&gt;a performance problem can come from how WordPress features interact with the existing setup—not just from the number of plugins installed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Getting the hosting logs helped me discover something I might otherwise have overlooked.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why you should understand a problem before fixing it
&lt;/h2&gt;

&lt;p&gt;Discovering the Heartbeat requests changed the direction of my investigation.&lt;/p&gt;

&lt;p&gt;I had started by looking at a website with many plugins, but the hosting support team's feedback gave me a more specific technical lead to investigate.&lt;/p&gt;

&lt;p&gt;This is why I prefer a systematic troubleshooting process:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Identify the symptoms.&lt;/li&gt;
&lt;li&gt;Gather evidence from logs and hosting support.&lt;/li&gt;
&lt;li&gt;Research unfamiliar technical details.&lt;/li&gt;
&lt;li&gt;Determine whether the evidence points to a likely cause.&lt;/li&gt;
&lt;li&gt;Test an appropriate solution and verify the outcome.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As developers, we don't have to know everything from memory. What matters is knowing how to investigate a problem, find reliable information, and test our assumptions.&lt;/p&gt;

&lt;p&gt;Of course, a large number of Heartbeat requests does not automatically prove that Heartbeat is the sole cause of a slow website. It is a clue that needs to be evaluated alongside other evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What about all those plugins?
&lt;/h2&gt;

&lt;p&gt;The experience also reinforced the importance of reviewing the plugins already installed on a WordPress website.&lt;/p&gt;

&lt;p&gt;When maintaining a client website, I ask questions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does every plugin still serve a necessary purpose?&lt;/li&gt;
&lt;li&gt;Are multiple plugins performing overlapping tasks?&lt;/li&gt;
&lt;li&gt;Could some functionality be provided by the hosting environment?&lt;/li&gt;
&lt;li&gt;Are any plugins generating excessive requests or background activity?&lt;/li&gt;
&lt;li&gt;Can I simplify the setup without breaking essential functionality?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Having many plugins isn't automatically a problem. A well-maintained website can run perfectly well with many plugins, while a single poorly performing component can create significant issues.&lt;/p&gt;

&lt;p&gt;The goal is not to achieve the lowest possible plugin count. It is to understand what each component does and whether it belongs in the current setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Two WordPress topics worth understanding: Heartbeat and WP-Cron
&lt;/h2&gt;

&lt;p&gt;This investigation introduced me to an area of WordPress that deserves more attention from developers: the background activity and periodic requests that happen beyond the visible page content.&lt;/p&gt;

&lt;p&gt;Two topics are particularly worth understanding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WordPress Heartbeat API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Heartbeat enables periodic communication between the browser and the server. Understanding its behavior can help when investigating excessive requests, but changing its settings carelessly can interfere with features that depend on it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WP-Cron&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WP-Cron is WordPress's mechanism for scheduling tasks. Plugins can use it for scheduled publishing, maintenance, recurring jobs, and other operations. Depending on the workload and configuration, scheduled tasks can also be worth investigating during performance troubleshooting.&lt;/p&gt;

&lt;p&gt;Although these two mechanisms serve different purposes, both are useful to understand when diagnosing WordPress websites.&lt;/p&gt;

&lt;p&gt;I'll explore &lt;strong&gt;WordPress Heartbeat and WP-Cron in more detail in future articles&lt;/strong&gt;, including how they work, how to investigate potential performance issues, and what developers should consider before changing their behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. My troubleshooting checklist
&lt;/h2&gt;

&lt;p&gt;Before installing another performance plugin, here are the checks I recommend:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Identify the actual symptoms instead of assuming the cause.&lt;/li&gt;
&lt;li&gt;[ ] Request hosting logs or review available error logs and resource metrics.&lt;/li&gt;
&lt;li&gt;[ ] Review the installed plugins and their responsibilities.&lt;/li&gt;
&lt;li&gt;[ ] Investigate unusual request patterns and background activity.&lt;/li&gt;
&lt;li&gt;[ ] Check what caching and backup features the hosting provider already offers.&lt;/li&gt;
&lt;li&gt;[ ] Research unfamiliar WordPress features before changing their configuration.&lt;/li&gt;
&lt;li&gt;[ ] Test changes carefully and verify that essential website functionality still works.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These steps won't solve every performance problem, but they can help narrow down the possible causes and prevent unnecessary changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;One of the most valuable lessons I've learned as a WordPress developer is that troubleshooting is a continuous learning process.&lt;/p&gt;

&lt;p&gt;When my client's hosting support team pointed out the large number of Heartbeat requests, I wasn't already an expert in that area. I learned about the feature because the problem gave me a reason to investigate it.&lt;/p&gt;

&lt;p&gt;That's part of working with WordPress: understanding the tools we use, learning how the platform behaves, and being willing to explore unfamiliar areas when a real problem requires it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before installing another plugin, take a step back, gather evidence, and understand what's happening behind the scenes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might discover that the most useful next step isn't adding another tool—it's learning something new about the system you're maintaining.&lt;/p&gt;




&lt;p&gt;I'm a &lt;strong&gt;WordPress&lt;/strong&gt;developer working with PHP, JavaScript, WooCommerce, custom themes, and plugins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Please Explore my &lt;a href="https://muhammad-medhat.github.io/portfolio/" rel="noopener noreferrer"&gt;portfolio&lt;/a&gt; or contact me on &lt;a href="https://www.linkedin.com/in/muhammad-medhat/" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>php</category>
      <category>webdev</category>
      <category>backend</category>
    </item>
    <item>
      <title>Building a Lightweight Bilingual WordPress Website Without Too Many Plugins</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Wed, 23 Sep 2026 13:20:18 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/building-a-lightweight-bilingual-wordpress-website-without-too-many-plugins-e6f</link>
      <guid>https://dev.to/muhammadmedhat/building-a-lightweight-bilingual-wordpress-website-without-too-many-plugins-e6f</guid>
      <description>&lt;p&gt;&lt;em&gt;How I used Advanced Custom Fields (ACF) and a lightweight custom-developed theme to build a QR restaurant menu.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;WordPress is a powerful content management system with an extensive ecosystem of themes and plugins. This flexibility makes it possible to build many different types of websites, but it also raises an important question: &lt;strong&gt;Do we always need multiple plugins to build a professional WordPress website?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my latest project, I worked on a QR restaurant menu that supports two languages. Instead of relying on a large collection of plugins, I used a lightweight custom-developed theme and Advanced Custom Fields (ACF) to manage the menu content.&lt;/p&gt;

&lt;p&gt;This project gave me an opportunity to apply a simple development principle: use the tools that match the actual requirements of the website.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why Consider a Lightweight WordPress Approach?
&lt;/h2&gt;

&lt;p&gt;Plugins are one of the reasons WordPress is so flexible. They allow developers to add functionality without building everything from scratch.&lt;/p&gt;

&lt;p&gt;However, installing plugins for every small requirement can introduce unnecessary complexity. Each additional plugin may bring its own assets, settings, updates, and compatibility considerations.&lt;/p&gt;

&lt;p&gt;When developing a website, I consider several factors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Avoid loading unnecessary resources and functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability:&lt;/strong&gt; Keep the codebase organized and easier to maintain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; Have control over the website's design and functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; Use reliable, maintained plugins and avoid unnecessary dependencies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Development efficiency:&lt;/strong&gt; Choose custom development when it is practical and appropriate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This doesn't mean that using many plugins is always wrong. Plugins can save development time and provide reliable, established functionality.&lt;/p&gt;

&lt;p&gt;The goal is not to eliminate plugins. It is to &lt;strong&gt;avoid unnecessary dependencies and choose the right solution for each project.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. My Approach: A Lightweight Custom-Developed Theme
&lt;/h2&gt;

&lt;p&gt;For my latest QR restaurant menu project, I chose to develop a lightweight WordPress theme tailored to the website's needs.&lt;/p&gt;

&lt;p&gt;Rather than depending on a multipurpose theme and several additional plugins, I focused on creating the required layout and functionality within the theme itself.&lt;/p&gt;

&lt;p&gt;The project included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A custom-developed, lightweight WordPress theme.&lt;/li&gt;
&lt;li&gt;A structured restaurant menu managed using ACF.&lt;/li&gt;
&lt;li&gt;Support for two languages.&lt;/li&gt;
&lt;li&gt;A responsive interface designed for visitors accessing the menu through a QR code.&lt;/li&gt;
&lt;li&gt;A focused content structure based on the restaurant's requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developing a theme around the actual project requirements gave me more control over the website's structure, styling, and content presentation.&lt;/p&gt;

&lt;p&gt;It also helped me think carefully about which functionality needed a plugin and which could be implemented directly in the theme.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Using Advanced Custom Fields (ACF) for Menu Content
&lt;/h2&gt;

&lt;p&gt;One of the main tools I used in the project was &lt;strong&gt;Advanced Custom Fields (ACF)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;ACF allows developers to create structured custom fields in WordPress, making it easier to manage content through the WordPress administration area.&lt;/p&gt;

&lt;p&gt;For a restaurant menu, each item can have several properties, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Description&lt;/li&gt;
&lt;li&gt;Price&lt;/li&gt;
&lt;li&gt;Category&lt;/li&gt;
&lt;li&gt;Image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of managing every item through a page builder, I used custom fields to organize the menu content in a consistent way.&lt;/p&gt;

&lt;p&gt;This approach helps separate the content from its presentation. The restaurant's menu information can be managed in WordPress, while the custom theme determines how visitors see it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why ACF?
&lt;/h3&gt;

&lt;p&gt;I chose ACF because it provided the structured content management capabilities needed for the project without requiring a more complex implementation.&lt;/p&gt;

&lt;p&gt;It allowed me to design the content fields according to the restaurant menu's requirements and then display that information through custom theme templates.&lt;/p&gt;

&lt;p&gt;For projects with structured content, tools like ACF can be a practical way to extend WordPress while keeping the development approach focused.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Managing Two Languages Without a Dedicated Translation Plugin
&lt;/h2&gt;

&lt;p&gt;One of the specific requirements of the project was supporting two languages for the restaurant menu.&lt;/p&gt;

&lt;p&gt;Instead of using a dedicated translation plugin, I managed the multilingual content through separate ACF fields for each language.&lt;/p&gt;

&lt;p&gt;For example, a menu item could include the following fields:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;name_en&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;English menu item name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;name_ar&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Arabic menu item name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;description_en&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;English description&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;description_ar&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Arabic description&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The custom theme then displays the appropriate fields based on the language selected by the visitor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why I chose this approach
&lt;/h3&gt;

&lt;p&gt;The restaurant menu had a relatively straightforward content structure, so I could design a multilingual solution around its specific requirements.&lt;/p&gt;

&lt;p&gt;Using separate fields for each language gave me control over how the content was stored and displayed. It also allowed me to avoid introducing a dedicated translation plugin for this particular project.&lt;/p&gt;

&lt;p&gt;However, this approach is not necessarily suitable for every multilingual website.&lt;/p&gt;

&lt;p&gt;Larger websites with many languages, complex translation workflows, frequent content updates, or multiple content types may benefit from a dedicated multilingual plugin or a different content architecture.&lt;/p&gt;

&lt;p&gt;The important lesson is that &lt;strong&gt;the multilingual implementation should be selected based on the project's scope, requirements, and future maintenance needs.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Developing Functionality Instead of Adding More Plugins
&lt;/h2&gt;

&lt;p&gt;During WordPress development, it can be tempting to search for a plugin whenever a new requirement appears.&lt;/p&gt;

&lt;p&gt;Sometimes, using a plugin is the most efficient and reliable solution. In other situations, the required functionality is simple enough to implement within a custom theme.&lt;/p&gt;

&lt;p&gt;For my QR restaurant menu, I considered the functionality that the website actually needed and focused on developing a tailored solution.&lt;/p&gt;

&lt;p&gt;Before adding a plugin, I usually consider questions such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Is this functionality essential to the project?&lt;/li&gt;
&lt;li&gt;Can it be implemented simply and safely?&lt;/li&gt;
&lt;li&gt;Does an existing plugin offer meaningful benefits?&lt;/li&gt;
&lt;li&gt;Will the solution be maintainable in the future?&lt;/li&gt;
&lt;li&gt;Does the feature require a mature, established system?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, custom menu layouts and menu-specific presentation can be handled by the theme. On the other hand, complex functionality such as payments, reservations, or advanced translation management may justify using an established plugin.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal is to make informed technical decisions rather than automatically choosing either plugins or custom development.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Performance and Maintainability
&lt;/h2&gt;

&lt;p&gt;A lightweight theme can help reduce unnecessary assets and simplify the website's structure, provided that it is developed efficiently.&lt;/p&gt;

&lt;p&gt;In WordPress projects, I pay attention to several areas that can affect performance and maintainability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loading only the CSS and JavaScript required by the website.&lt;/li&gt;
&lt;li&gt;Keeping the theme structure organized.&lt;/li&gt;
&lt;li&gt;Avoiding unnecessary dependencies.&lt;/li&gt;
&lt;li&gt;Using reusable template components.&lt;/li&gt;
&lt;li&gt;Managing structured content through appropriate fields.&lt;/li&gt;
&lt;li&gt;Considering the mobile experience from the beginning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a QR restaurant menu, mobile usability is particularly important because visitors commonly access the website through their smartphones.&lt;/p&gt;

&lt;p&gt;However, a website's performance depends on more than its plugin count. Hosting, image optimization, caching, database queries, and the quality of the theme code all contribute to the overall experience.&lt;/p&gt;

&lt;p&gt;Therefore, using fewer plugins does not automatically guarantee a faster website. &lt;strong&gt;Efficient development, appropriate architecture, and performance testing are more important than simply counting plugins.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What I Learned from the Project
&lt;/h2&gt;

&lt;p&gt;Building the bilingual QR restaurant menu reinforced my interest in developing WordPress websites that are tailored to specific business needs.&lt;/p&gt;

&lt;p&gt;The project brought together several aspects of WordPress development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a lightweight custom-developed theme.&lt;/li&gt;
&lt;li&gt;Using ACF to manage structured menu content.&lt;/li&gt;
&lt;li&gt;Implementing bilingual content through separate language fields.&lt;/li&gt;
&lt;li&gt;Designing a website for mobile visitors.&lt;/li&gt;
&lt;li&gt;Making plugin decisions based on project requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also reminded me that WordPress development involves more than installing themes and plugins.&lt;/p&gt;

&lt;p&gt;A developer needs to think about how content is organized, how functionality is implemented, how users interact with the website, and how the solution can be maintained over time.&lt;/p&gt;

&lt;p&gt;Even a relatively simple website can benefit from thoughtful planning and a clear development approach.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;You don't always need many plugins to build a professional WordPress website.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my latest project, I used Advanced Custom Fields (ACF) and a lightweight custom-developed theme to build a bilingual QR restaurant menu.&lt;/p&gt;

&lt;p&gt;By managing the two languages through separate custom fields and developing the required functionality around the project's needs, I was able to create a focused solution without relying on a dedicated translation plugin.&lt;/p&gt;

&lt;p&gt;This approach is not a universal replacement for plugins. Instead, it demonstrates the value of choosing an appropriate balance between custom development and existing tools.&lt;/p&gt;

&lt;p&gt;The best WordPress solution is not necessarily the one with the fewest plugins or the most custom code. It is the one that meets the project's requirements while maintaining a practical balance of &lt;strong&gt;performance, flexibility, maintainability, and development effort.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As a WordPress developer, I believe that understanding when to use a plugin and when to develop a tailored solution is an important part of building better websites.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>acf</category>
      <category>themes</category>
      <category>performance</category>
    </item>
    <item>
      <title>WordPress Block Themes vs Classic Themes: Should You Switch in 2026?</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Sun, 16 Aug 2026 15:10:57 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/wordpress-block-themes-vs-classic-themes-should-you-switch-in-2026-2dp6</link>
      <guid>https://dev.to/muhammadmedhat/wordpress-block-themes-vs-classic-themes-should-you-switch-in-2026-2dp6</guid>
      <description>&lt;p&gt;If you've been developing WordPress websites for several years, there's a good chance you've spent a lot of time working with files like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;header.php
footer.php
single.php
page.php
archive.php
functions.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's certainly where most of my WordPress development experience has been.&lt;/p&gt;

&lt;p&gt;But WordPress has been changing.&lt;/p&gt;

&lt;p&gt;With the Block Editor, Site Editor, block themes, patterns, and &lt;code&gt;theme.json&lt;/code&gt;, WordPress now offers a very different approach to theme development.&lt;/p&gt;

&lt;p&gt;So I decided to take a closer look at the question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;If you're already comfortable building classic WordPress themes, is it worth moving toward block themes in 2026?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This isn't an article written from the perspective of someone who has spent years exclusively building block themes. Most of my own WordPress work has traditionally involved &lt;strong&gt;classic themes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead, I'm looking at block themes from the perspective of an experienced WordPress developer who is exploring how the platform is evolving—and where the newer approach fits alongside the architecture I've used extensively.&lt;/p&gt;




&lt;h2&gt;
  
  
  Classic Themes vs Block Themes
&lt;/h2&gt;

&lt;p&gt;WordPress currently identifies two primary theme types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classic themes&lt;/li&gt;
&lt;li&gt;Block themes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;According to the official WordPress Theme Developer Handbook, classic themes primarily use PHP, JavaScript, and CSS and can make extensive use of WordPress functions, hooks, and filters.&lt;/p&gt;

&lt;p&gt;Block themes, on the other hand, are built around block markup and HTML-based templates and allow users to edit more areas of the website through the Site Editor.&lt;/p&gt;

&lt;p&gt;A simplified comparison looks like this:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Classic Theme&lt;/th&gt;
&lt;th&gt;Block Theme&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PHP templates&lt;/td&gt;
&lt;td&gt;HTML block templates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;single.php&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;templates/single.html&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;header.php&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Template parts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;footer.php&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Template parts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Template hierarchy&lt;/td&gt;
&lt;td&gt;Block-based templates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Custom PHP logic&lt;/td&gt;
&lt;td&gt;Blocks + APIs + plugins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customizer / theme options&lt;/td&gt;
&lt;td&gt;Site Editor / Styles&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;theme.json&lt;/code&gt; optional&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;theme.json&lt;/code&gt; commonly used&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This doesn't mean classic themes are obsolete.&lt;/p&gt;

&lt;p&gt;They aren't.&lt;/p&gt;

&lt;p&gt;WordPress continues to maintain documentation for classic theme development, and classic themes remain a valid part of the platform.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I'm Used to: Classic Themes
&lt;/h2&gt;

&lt;p&gt;A traditional WordPress theme might have a structure like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-theme/
├── style.css
├── functions.php
├── index.php
├── header.php
├── footer.php
├── sidebar.php
├── single.php
├── page.php
├── archive.php
└── 404.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The templates contain PHP and WordPress template functions.&lt;/p&gt;

&lt;p&gt;For example:&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="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nf"&gt;get_header&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"site-content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="cp"&gt;&amp;lt;?php&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;have_posts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

        &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nf"&gt;have_posts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;the_post&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nf"&gt;post_class&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

                &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nf"&gt;the_title&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

                &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"entry-content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nf"&gt;the_content&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

            &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

        &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;endwhile&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

    &lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nf"&gt;get_footer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For developers who have spent years working with WordPress, this architecture is very familiar.&lt;/p&gt;

&lt;p&gt;You have direct access to PHP, the Loop, template files, hooks, filters, conditional tags, queries, and all the other tools that make WordPress flexible.&lt;/p&gt;

&lt;p&gt;The official WordPress documentation still describes this as the classic theme approach.&lt;/p&gt;




&lt;h2&gt;
  
  
  So What Is a Block Theme?
&lt;/h2&gt;

&lt;p&gt;A block theme changes the way the theme's templates are constructed.&lt;/p&gt;

&lt;p&gt;Instead of building your main templates using PHP, you use HTML files containing WordPress block markup.&lt;/p&gt;

&lt;p&gt;A simplified block theme might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-block-theme/
├── style.css
├── theme.json
├── templates/
│   ├── index.html
│   ├── single.html
│   └── page.html
└── parts/
    ├── header.html
    └── footer.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;single.html&lt;/code&gt; template could look something like:&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="c"&gt;&amp;lt;!-- wp:template-part {"slug":"header"} /--&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- wp:group {"tagName":"main"} --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"wp-block-group"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="c"&gt;&amp;lt;!-- wp:post-title /--&amp;gt;&lt;/span&gt;

    &lt;span class="c"&gt;&amp;lt;!-- wp:post-featured-image /--&amp;gt;&lt;/span&gt;

    &lt;span class="c"&gt;&amp;lt;!-- wp:post-content /--&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- /wp:group --&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- wp:template-part {"slug":"footer"} /--&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's no traditional PHP Loop here.&lt;/p&gt;

&lt;p&gt;Instead, the template is composed of blocks.&lt;/p&gt;

&lt;p&gt;WordPress defines a block theme as a theme that has an &lt;code&gt;index.html&lt;/code&gt; template in the &lt;code&gt;templates&lt;/code&gt; or &lt;code&gt;block-templates&lt;/code&gt; directory, with templates built from block markup.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Big Difference: Who Controls the Layout?
&lt;/h2&gt;

&lt;p&gt;This is probably the most important conceptual difference.&lt;/p&gt;

&lt;p&gt;With a traditional classic theme, the developer typically controls the site's structure through PHP template files.&lt;/p&gt;

&lt;p&gt;With a block theme, the Site Editor can be used to edit areas such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Header&lt;/li&gt;
&lt;li&gt;Footer&lt;/li&gt;
&lt;li&gt;Navigation&lt;/li&gt;
&lt;li&gt;Templates&lt;/li&gt;
&lt;li&gt;Template parts&lt;/li&gt;
&lt;li&gt;Global styles&lt;/li&gt;
&lt;li&gt;Other block-based content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means the site owner can have significantly more control over the structure of the website without modifying PHP files.&lt;/p&gt;

&lt;p&gt;WordPress describes this as one of the major advantages of block themes.&lt;/p&gt;

&lt;p&gt;For a client who frequently wants to modify the website layout, this can be a big advantage.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where Does &lt;code&gt;theme.json&lt;/code&gt; Fit?
&lt;/h2&gt;

&lt;p&gt;This is one of the areas I find particularly interesting.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;theme.json&lt;/code&gt; is a configuration file that allows developers to define global settings and styles for a WordPress theme.&lt;/p&gt;

&lt;p&gt;And importantly:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;theme.json&lt;/code&gt; isn't exclusive to block themes.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;WordPress's official documentation explicitly states that &lt;code&gt;theme.json&lt;/code&gt; works with &lt;strong&gt;both block and classic themes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That makes it especially interesting for developers who primarily work with classic themes.&lt;/p&gt;

&lt;p&gt;You don't necessarily need to abandon your existing development approach to start using modern WordPress features.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Simple &lt;code&gt;theme.json&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;A basic modern &lt;code&gt;theme.json&lt;/code&gt; could look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://schemas.wp.org/wp/6.6/theme.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"settings"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"appearanceTools"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"layout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"contentSize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"720px"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"wideSize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1200px"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are two properties here that developers should understand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="s2"&gt;"$schema"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They aren't the same thing.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;version&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;version&lt;/code&gt; property specifies which &lt;code&gt;theme.json&lt;/code&gt; schema version the theme is using.&lt;/p&gt;

&lt;p&gt;As of the current official documentation, &lt;strong&gt;Version 3 is the latest &lt;code&gt;theme.json&lt;/code&gt; version&lt;/strong&gt;. Version 3 works with WordPress 6.6 and later.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;$schema&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;$schema&lt;/code&gt; property tells development tools which JSON Schema to use.&lt;/p&gt;

&lt;p&gt;This can provide features such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Autocomplete&lt;/li&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Editor hints&lt;/li&gt;
&lt;li&gt;Error reporting&lt;/li&gt;
&lt;li&gt;Property suggestions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;WordPress provides schemas for individual WordPress versions, and its documentation recommends using the oldest WordPress version your theme supports when choosing a version-specific schema.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://schemas.wp.org/wp/6.6/theme.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your theme targets a different minimum WordPress version, use the appropriate schema URL for that target.&lt;/p&gt;

&lt;p&gt;For the latest development schema, WordPress also provides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://schemas.wp.org/trunk/theme.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, for a production theme, targeting the appropriate stable WordPress version is generally safer than relying on &lt;code&gt;trunk&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Is &lt;code&gt;theme.json&lt;/code&gt; Important?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;theme.json&lt;/code&gt; can control a surprisingly large part of the WordPress design system.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://schemas.wp.org/wp/6.6/theme.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;

    &lt;/span&gt;&lt;span class="nl"&gt;"settings"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"palette"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"slug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"primary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#2563eb"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Primary"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"slug"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dark"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#111827"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Dark"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;

        &lt;/span&gt;&lt;span class="nl"&gt;"typography"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"fluid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use &lt;code&gt;theme.json&lt;/code&gt; for things such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Color palettes&lt;/li&gt;
&lt;li&gt;Typography&lt;/li&gt;
&lt;li&gt;Spacing&lt;/li&gt;
&lt;li&gt;Layout&lt;/li&gt;
&lt;li&gt;Borders&lt;/li&gt;
&lt;li&gt;Shadows&lt;/li&gt;
&lt;li&gt;Block settings&lt;/li&gt;
&lt;li&gt;Custom templates&lt;/li&gt;
&lt;li&gt;Template parts&lt;/li&gt;
&lt;li&gt;Patterns&lt;/li&gt;
&lt;li&gt;Global styles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The official documentation describes &lt;code&gt;theme.json&lt;/code&gt; as a configuration file for global settings, styles, templates, template parts, and more.&lt;/p&gt;




&lt;h2&gt;
  
  
  Classic Themes Can Use Modern WordPress Features Too
&lt;/h2&gt;

&lt;p&gt;This is an important point that sometimes gets lost in the block-theme discussion.&lt;/p&gt;

&lt;p&gt;You don't necessarily have:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Classic theme &lt;strong&gt;OR&lt;/strong&gt; modern WordPress.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is a middle ground.&lt;/p&gt;

&lt;p&gt;WordPress documentation specifically notes that classic themes can use &lt;code&gt;theme.json&lt;/code&gt; and take advantage of block-editor functionality.&lt;/p&gt;

&lt;p&gt;The WordPress community sometimes calls these &lt;strong&gt;hybrid themes&lt;/strong&gt;—classic themes that adopt some modern block-related functionality.&lt;/p&gt;

&lt;p&gt;WordPress notes that "hybrid theme" is a commonly used community term rather than an official third theme type.&lt;/p&gt;

&lt;p&gt;This is actually an interesting option for developers like me who have extensive experience with classic themes.&lt;/p&gt;

&lt;p&gt;You can gradually adopt newer WordPress capabilities without necessarily rewriting an entire project.&lt;/p&gt;




&lt;h2&gt;
  
  
  Template Parts: PHP vs Blocks
&lt;/h2&gt;

&lt;p&gt;Here's another example of the architectural difference.&lt;/p&gt;

&lt;p&gt;In a classic theme, you might have:&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="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nf"&gt;get_header&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;

...

&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="nf"&gt;get_footer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;WordPress also provides functions such as:&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;get_template_part&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for reusing template components.&lt;/p&gt;

&lt;p&gt;With a block theme, you can use template-part blocks:&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="c"&gt;&amp;lt;!-- wp:template-part {"slug":"header"} /--&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- wp:post-content /--&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- wp:template-part {"slug":"footer"} /--&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The underlying concept is similar:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reuse common parts of your website.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But the implementation is different.&lt;/p&gt;

&lt;p&gt;The classic approach uses PHP templates and WordPress functions.&lt;/p&gt;

&lt;p&gt;The block approach uses block markup and template parts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Does a Block Theme Mean No PHP?
&lt;/h2&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;This is another misconception worth clearing up.&lt;/p&gt;

&lt;p&gt;WordPress is still a PHP application.&lt;/p&gt;

&lt;p&gt;Plugins can still register:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Custom post types&lt;/li&gt;
&lt;li&gt;Taxonomies&lt;/li&gt;
&lt;li&gt;REST API endpoints&lt;/li&gt;
&lt;li&gt;Hooks&lt;/li&gt;
&lt;li&gt;Filters&lt;/li&gt;
&lt;li&gt;Custom functionality&lt;/li&gt;
&lt;li&gt;Server-side logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&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;'init'&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;register_post_type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'portfolio'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'public'&lt;/span&gt;   &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'label'&lt;/span&gt;    &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Portfolio'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'supports'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'editor'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'thumbnail'&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="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is primarily in &lt;strong&gt;how the theme handles presentation and templates&lt;/strong&gt;, not that PHP suddenly disappears from WordPress.&lt;/p&gt;

&lt;p&gt;In fact, keeping application/business functionality in plugins rather than tying it tightly to the theme is often a useful architectural approach.&lt;/p&gt;




&lt;h2&gt;
  
  
  When Would I Still Choose a Classic Theme?
&lt;/h2&gt;

&lt;p&gt;This is where my own experience influences my answer.&lt;/p&gt;

&lt;p&gt;If I were working on an existing project that is already built around a classic theme and works well, I wouldn't automatically recommend rebuilding it as a block theme.&lt;/p&gt;

&lt;p&gt;There has to be a reason.&lt;/p&gt;

&lt;p&gt;For example, I'd be comfortable continuing with a classic theme when:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The existing architecture works
&lt;/h3&gt;

&lt;p&gt;If the site is stable, maintainable, and meeting the client's requirements, changing architecture just because a newer approach exists doesn't necessarily provide enough value.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The project relies heavily on custom PHP templates
&lt;/h3&gt;

&lt;p&gt;Some projects have complex template logic and custom integrations where the traditional PHP architecture is already a good fit.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The team knows the classic architecture well
&lt;/h3&gt;

&lt;p&gt;Development speed and maintainability matter.&lt;/p&gt;

&lt;p&gt;If a team can build and maintain a classic theme efficiently, that has real value.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The client doesn't need full Site Editor control
&lt;/h3&gt;

&lt;p&gt;If the website structure is intentionally controlled by developers, the biggest advantage of a block theme may not be necessary.&lt;/p&gt;




&lt;h2&gt;
  
  
  When Would I Consider a Block Theme?
&lt;/h2&gt;

&lt;p&gt;For a new project, however, I would definitely consider a block theme.&lt;/p&gt;

&lt;p&gt;Especially when:&lt;/p&gt;

&lt;h3&gt;
  
  
  The client wants visual control
&lt;/h3&gt;

&lt;p&gt;If the client wants to modify headers, footers, templates, and global styles without involving a developer, the Site Editor can be very useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  The website is heavily block-based
&lt;/h3&gt;

&lt;p&gt;If the entire content strategy already revolves around Gutenberg, patterns, and blocks, a block theme can be a natural fit.&lt;/p&gt;

&lt;h3&gt;
  
  
  You want a centralized design system
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;theme.json&lt;/code&gt; provides a structured way to define colors, typography, spacing, layout, and other design settings.&lt;/p&gt;

&lt;h3&gt;
  
  
  You're building a new theme from scratch
&lt;/h3&gt;

&lt;p&gt;A new project gives you an opportunity to adopt the architecture without having to migrate years of existing code.&lt;/p&gt;

&lt;p&gt;WordPress's current Theme Handbook describes block themes as the modern method of building WordPress themes and says its theme-development documentation primarily focuses on this approach.&lt;/p&gt;




&lt;h2&gt;
  
  
  What About Performance?
&lt;/h2&gt;

&lt;p&gt;This is one area where I would avoid making absolute claims.&lt;/p&gt;

&lt;p&gt;You'll sometimes hear:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Block themes are faster."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Or:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Classic themes are faster."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Neither statement is universally true.&lt;/p&gt;

&lt;p&gt;Performance depends on the implementation.&lt;/p&gt;

&lt;p&gt;A poorly optimized block theme can be slow.&lt;/p&gt;

&lt;p&gt;A carefully built classic theme can be extremely fast.&lt;/p&gt;

&lt;p&gt;Things such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hosting&lt;/li&gt;
&lt;li&gt;Database queries&lt;/li&gt;
&lt;li&gt;Images&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;Third-party scripts&lt;/li&gt;
&lt;li&gt;Plugins&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;Page complexity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;can all have a major impact.&lt;/p&gt;

&lt;p&gt;So I wouldn't choose a theme architecture based solely on the assumption that one is automatically faster.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Should a Classic-Theme Developer Learn?
&lt;/h2&gt;

&lt;p&gt;This is probably the question I'm asking myself as much as anyone reading this article.&lt;/p&gt;

&lt;p&gt;If you've already spent years learning classic WordPress development, should you throw all of that knowledge away?&lt;/p&gt;

&lt;p&gt;Definitely not.&lt;/p&gt;

&lt;p&gt;I would look at it as an expansion of your existing skills.&lt;/p&gt;

&lt;p&gt;A reasonable learning path could be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Classic WordPress Development
            ↓
       Gutenberg
            ↓
       Block Editor
            ↓
       theme.json
            ↓
       Block Patterns
            ↓
       Block Themes
            ↓
      Custom Blocks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your existing knowledge of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;li&gt;WordPress hooks&lt;/li&gt;
&lt;li&gt;Filters&lt;/li&gt;
&lt;li&gt;Template hierarchy&lt;/li&gt;
&lt;li&gt;The Loop&lt;/li&gt;
&lt;li&gt;Custom post types&lt;/li&gt;
&lt;li&gt;REST APIs&lt;/li&gt;
&lt;li&gt;Plugins&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;doesn't become useless.&lt;/p&gt;

&lt;p&gt;You're simply adding another layer to your WordPress toolkit.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Perspective as a WordPress Developer
&lt;/h2&gt;

&lt;p&gt;Most of my WordPress development experience has been with &lt;strong&gt;classic themes&lt;/strong&gt;, so I'm not going to pretend that I've spent the majority of my career building block themes.&lt;/p&gt;

&lt;p&gt;I haven't.&lt;/p&gt;

&lt;p&gt;But that's exactly why I found the evolution interesting.&lt;/p&gt;

&lt;p&gt;When you've been working with WordPress for years, it's easy to keep using the architecture you're comfortable with.&lt;/p&gt;

&lt;p&gt;And there is nothing wrong with that when the architecture is appropriate.&lt;/p&gt;

&lt;p&gt;But WordPress is clearly investing heavily in the block-based direction.&lt;/p&gt;

&lt;p&gt;The official Theme Handbook now describes block themes as the modern method of building themes and focuses its current guidance heavily on that approach.&lt;/p&gt;

&lt;p&gt;For me, that doesn't mean:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Classic themes are dead."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It means:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"As WordPress developers, we should understand where the platform is going, even if our current projects still use the architecture we're most experienced with."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the approach I'm taking.&lt;/p&gt;

&lt;p&gt;I'm not replacing my classic-theme knowledge.&lt;/p&gt;

&lt;p&gt;I'm expanding it.&lt;/p&gt;




&lt;h2&gt;
  
  
  So, Should You Switch?
&lt;/h2&gt;

&lt;p&gt;My answer is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It depends.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're maintaining an existing classic WordPress website that works well, I wouldn't migrate it simply because block themes are newer.&lt;/p&gt;

&lt;p&gt;If you're starting a new project, I'd at least evaluate whether a block theme makes sense.&lt;/p&gt;

&lt;p&gt;And if you're a WordPress developer who has mostly worked with classic themes, I'd definitely recommend learning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Block Editor
theme.json
Patterns
Template Parts
Site Editor
Block Themes
Custom Blocks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't need to become a block-theme expert overnight.&lt;/p&gt;

&lt;p&gt;But understanding the architecture will make it much easier to work with modern WordPress projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;WordPress theme development isn't necessarily a choice between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Classic = Old
Block = New
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's more nuanced than that.&lt;/p&gt;

&lt;p&gt;Classic themes remain powerful and relevant.&lt;/p&gt;

&lt;p&gt;Block themes provide a newer approach that gives WordPress users much greater control over templates and site-wide design through blocks and the Site Editor.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;theme.json&lt;/code&gt; provides an interesting bridge between the two worlds because it can be used with both classic and block themes.&lt;/p&gt;

&lt;p&gt;For developers who have spent years working with classic themes, the goal shouldn't be to forget everything we already know.&lt;/p&gt;

&lt;p&gt;The goal is to understand the new architecture well enough to decide &lt;strong&gt;when it actually makes sense to use it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That's where I currently see the value in learning block themes.&lt;/p&gt;

&lt;p&gt;Not because classic themes have suddenly become irrelevant—but because WordPress itself is evolving, and we should evolve with it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Official WordPress References
&lt;/h2&gt;

&lt;p&gt;This article is based primarily on the official WordPress Developer Documentation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WordPress Theme Developer Handbook&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://developer.wordpress.org/themes/" rel="noopener noreferrer"&gt;https://developer.wordpress.org/themes/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;What Is a Theme?&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://developer.wordpress.org/themes/getting-started/what-is-a-theme/" rel="noopener noreferrer"&gt;https://developer.wordpress.org/themes/getting-started/what-is-a-theme/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Block Editor — Themes&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://developer.wordpress.org/block-editor/how-to-guides/themes/" rel="noopener noreferrer"&gt;https://developer.wordpress.org/block-editor/how-to-guides/themes/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Introduction to &lt;code&gt;theme.json&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://developer.wordpress.org/themes/global-settings-and-styles/introduction-to-theme-json/" rel="noopener noreferrer"&gt;https://developer.wordpress.org/themes/global-settings-and-styles/introduction-to-theme-json/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;theme.json&lt;/code&gt; Version 3 Reference&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/" rel="noopener noreferrer"&gt;https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Developing with &lt;code&gt;theme.json&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://developer.wordpress.org/block-editor/how-to-guides/themes/global-settings-and-styles/" rel="noopener noreferrer"&gt;https://developer.wordpress.org/block-editor/how-to-guides/themes/global-settings-and-styles/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Classic Themes&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://developer.wordpress.org/themes/classic-themes/" rel="noopener noreferrer"&gt;https://developer.wordpress.org/themes/classic-themes/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All technical claims and examples in this article should be checked against the official documentation for the WordPress version your project supports, particularly when working with &lt;code&gt;theme.json&lt;/code&gt; versions and schemas.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>php</category>
      <category>webdev</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>What's New in WordPress 7.0: Key Features and Improvements</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Wed, 08 Jul 2026 15:01:52 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/whats-new-in-wordpress-70-key-features-and-improvements-59e3</link>
      <guid>https://dev.to/muhammadmedhat/whats-new-in-wordpress-70-key-features-and-improvements-59e3</guid>
      <description>&lt;p&gt;WordPress 7.0, codenamed &lt;strong&gt;"Armstrong,"&lt;/strong&gt; was officially released on &lt;strong&gt;May 20, 2026&lt;/strong&gt;. This release focuses on improving publishing workflows, enhancing the editing experience, expanding AI infrastructure, and providing new tools for developers while maintaining WordPress's commitment to performance, accessibility, and extensibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Infrastructure in WordPress Core
&lt;/h2&gt;

&lt;p&gt;One of the biggest additions in WordPress 7.0 is the introduction of foundational AI infrastructure. Rather than providing a built-in AI writing assistant, WordPress now includes a standardized AI Client and connector framework that allows plugins and services to integrate AI capabilities in a consistent way. This approach gives developers a common foundation for building AI-powered features without tying WordPress to a specific AI provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improved Publishing Workflows
&lt;/h2&gt;

&lt;p&gt;WordPress 7.0 introduces several workflow enhancements that make creating and managing content more efficient. The release streamlines common editorial tasks and improves the overall publishing experience, helping content creators spend less time navigating the interface and more time producing content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enhanced Block Editor
&lt;/h2&gt;

&lt;p&gt;The Block Editor receives a variety of improvements aimed at making page building faster and more intuitive. Users benefit from a smoother editing experience, while new capabilities provide greater flexibility when designing pages and managing content layouts. These refinements continue WordPress's evolution toward a fully visual site-building experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Better Tools for Developers
&lt;/h2&gt;

&lt;p&gt;WordPress 7.0 includes numerous updates for plugin and theme developers. The release introduces new APIs and infrastructure that simplify extending WordPress while maintaining compatibility with existing development practices. The accompanying Field Guide outlines developer-focused enhancements and any important breaking changes developers should review before upgrading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance, Accessibility, and Stability
&lt;/h2&gt;

&lt;p&gt;As with every major release, WordPress 7.0 includes performance optimizations, accessibility improvements, bug fixes, and security updates. These enhancements improve the overall user experience for both site visitors and administrators while ensuring WordPress remains reliable and maintainable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Upgrade to WordPress 7.0?
&lt;/h2&gt;

&lt;p&gt;Upgrading to WordPress 7.0 offers several benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modern AI integration infrastructure for plugins and services.&lt;/li&gt;
&lt;li&gt;Improved publishing and editing workflows.&lt;/li&gt;
&lt;li&gt;Enhanced Block Editor experience.&lt;/li&gt;
&lt;li&gt;New developer APIs and extensibility improvements.&lt;/li&gt;
&lt;li&gt;Better performance, accessibility, and stability.&lt;/li&gt;
&lt;li&gt;Ongoing security and maintenance updates.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;WordPress 7.0 represents an important step forward for the platform by modernizing content creation workflows and laying the foundation for future AI-powered functionality. While many improvements are focused on infrastructure and developer experience, site owners and content creators also benefit from a smoother editing interface, improved performance, and a more efficient publishing process. Before upgrading, it's recommended to back up your website and verify that your themes and plugins are compatible with WordPress 7.0.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>backend</category>
      <category>web</category>
    </item>
    <item>
      <title>Container Queries: The CSS Feature I Wish I Had Years Ago</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Sun, 14 Jun 2026 15:02:41 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/container-queries-the-css-feature-i-wish-i-had-years-ago-2h63</link>
      <guid>https://dev.to/muhammadmedhat/container-queries-the-css-feature-i-wish-i-had-years-ago-2h63</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For years, responsive design meant one thing:&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;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;768px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Media queries work great when you want to adapt a layout based on the viewport size.&lt;/p&gt;

&lt;p&gt;But what if a component lives inside a narrow sidebar on a large screen?&lt;/p&gt;

&lt;p&gt;Or inside a wide content area on a tablet?&lt;/p&gt;

&lt;p&gt;That's where Container Queries shine.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem With Media Queries
&lt;/h2&gt;

&lt;p&gt;Imagine a card component:&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;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    ...
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You want the card to switch layouts when it becomes too narrow.&lt;/p&gt;

&lt;p&gt;With media queries, you're forced to react to the viewport:&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;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;768px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&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;The problem?&lt;/p&gt;

&lt;p&gt;The viewport may be large while the card's container is small.&lt;/p&gt;

&lt;p&gt;The component doesn't actually know how much space it has available.&lt;/p&gt;




&lt;h2&gt;
  
  
  Enter Container Queries
&lt;/h2&gt;

&lt;p&gt;Container Queries allow a component to respond to the size of its parent container rather than the viewport.&lt;/p&gt;

&lt;p&gt;First, define a container:&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;.cards-wrapper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-size&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 create queries based on that container:&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;@container&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&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;Now the card adapts based on the space it actually has.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Real Example
&lt;/h2&gt;

&lt;p&gt;Imagine a product card:&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;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"products"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;article&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"product-card"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"product.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Product Name&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Description&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default layout:&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;.product-card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&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;Make the parent a container:&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;.products&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-size&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;Change layout when space becomes limited:&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;@container&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;450px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;.product-card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&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;The card becomes fully reusable regardless of where it's placed.&lt;/p&gt;




&lt;h2&gt;
  
  
  When I Use Container Queries
&lt;/h2&gt;

&lt;p&gt;I find them most useful for reusable components like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product cards&lt;/li&gt;
&lt;li&gt;Team member cards&lt;/li&gt;
&lt;li&gt;Dashboard widgets&lt;/li&gt;
&lt;li&gt;Pricing tables&lt;/li&gt;
&lt;li&gt;Sidebar blocks&lt;/li&gt;
&lt;li&gt;Custom WordPress blocks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of designing around the page, you design around the component itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  Container Queries vs Media Queries
&lt;/h2&gt;

&lt;p&gt;Use Media Queries when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adjusting page layouts&lt;/li&gt;
&lt;li&gt;Changing navigation behavior&lt;/li&gt;
&lt;li&gt;Responding to viewport size&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use Container Queries when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Building reusable components&lt;/li&gt;
&lt;li&gt;Creating modular UI systems&lt;/li&gt;
&lt;li&gt;Designing components that appear in different layouts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I don't see them as competitors.&lt;/p&gt;

&lt;p&gt;They solve different problems and often work together.&lt;/p&gt;




&lt;h2&gt;
  
  
  Browser Support
&lt;/h2&gt;

&lt;p&gt;Container Queries are now supported in all modern browsers, making them practical for production projects.&lt;/p&gt;

&lt;p&gt;Always verify support requirements if you're targeting older browsers, but for most modern projects they're ready to use.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Container Queries changed the way I think about responsive design.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How wide is the screen?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I can ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How much space does this component actually have?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That small shift makes components more reusable, predictable, and easier to maintain.&lt;/p&gt;

&lt;p&gt;If you're still relying only on media queries, Container Queries are definitely worth adding to your CSS toolbox.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>html</category>
      <category>frontend</category>
    </item>
    <item>
      <title>🧠 AI Tools That Actually Help Developers (And How I Use Them Daily)</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Mon, 06 Apr 2026 16:28:42 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/ai-tools-that-actually-help-developers-and-how-i-use-them-daily-1ndj</link>
      <guid>https://dev.to/muhammadmedhat/ai-tools-that-actually-help-developers-and-how-i-use-them-daily-1ndj</guid>
      <description>&lt;p&gt;There’s no shortage of AI tools right now.&lt;/p&gt;

&lt;p&gt;Every week, a new tool promises to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace developers&lt;/li&gt;
&lt;li&gt;Build full apps in seconds&lt;/li&gt;
&lt;li&gt;10x your productivity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But if you’re actually working on real projects, you already know the truth:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Most of these tools don’t fit into your daily workflow.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So instead of another “Top 7 AI Tools” list, this is something more practical:&lt;/p&gt;

&lt;p&gt;👉 The AI tools I actually use as a developer&lt;br&gt;
👉 And how they fit into real work — especially in WordPress projects&lt;/p&gt;


&lt;h2&gt;
  
  
  🚀 ChatGPT — My Daily Development Assistant
&lt;/h2&gt;

&lt;p&gt;Out of all the tools, this is the one I use the most.&lt;/p&gt;

&lt;p&gt;Not because it’s magical —&lt;br&gt;
But because it saves time where it actually matters.&lt;/p&gt;
&lt;h3&gt;
  
  
  How I use it daily:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Debugging WordPress issues&lt;/li&gt;
&lt;li&gt;Writing and fixing PHP functions&lt;/li&gt;
&lt;li&gt;Understanding hooks and filters faster&lt;/li&gt;
&lt;li&gt;Refactoring messy code&lt;/li&gt;
&lt;li&gt;Generating starting points instead of searching for hours&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Opening 5 tabs, reading random answers, testing blindly…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I describe the problem clearly and iterate.&lt;/p&gt;


&lt;h3&gt;
  
  
  🔧 Real Example from My Workflow
&lt;/h3&gt;

&lt;p&gt;Let’s say I need:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A custom WooCommerce function to modify checkout fields&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search&lt;/li&gt;
&lt;li&gt;Read documentation&lt;/li&gt;
&lt;li&gt;Try multiple snippets&lt;/li&gt;
&lt;li&gt;Debug manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I ask ChatGPT&lt;/li&gt;
&lt;li&gt;Get a working draft&lt;/li&gt;
&lt;li&gt;Adjust it based on my project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 What used to take an hour can take minutes&lt;/p&gt;


&lt;h3&gt;
  
  
  🎥 See It in Action
&lt;/h3&gt;

&lt;p&gt;If you want to see how I actually use ChatGPT during real development work, I made a full video where I walk through practical examples step by step:&lt;/p&gt;

&lt;p&gt;👉 &lt;em&gt;  &lt;iframe src="https://www.youtube.com/embed/sZdVSzbEnCw"&gt;
  &lt;/iframe&gt;
&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This isn’t a “look what AI can do” demo —&lt;br&gt;
It’s how I use it inside real projects.&lt;/p&gt;


&lt;h2&gt;
  
  
  ⚙️ AI Inside the Tools You Already Use
&lt;/h2&gt;

&lt;p&gt;One thing many developers miss:&lt;/p&gt;

&lt;p&gt;AI isn’t just standalone tools anymore —&lt;br&gt;
It’s built into the tools you already use.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Copilot → speeds up repetitive coding&lt;/li&gt;
&lt;li&gt;IDE AI assistants → smarter suggestions&lt;/li&gt;
&lt;li&gt;Canva AI → quick visuals for content or clients&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren’t revolutionary on their own —&lt;br&gt;
But they remove friction.&lt;/p&gt;

&lt;p&gt;👉 And removing friction is what actually improves your workflow&lt;/p&gt;


&lt;h2&gt;
  
  
  🧩 AI for Learning (Faster Than Documentation Alone)
&lt;/h2&gt;

&lt;p&gt;AI changed how I learn new things.&lt;/p&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Long documentation&lt;/li&gt;
&lt;li&gt;Multiple tutorials&lt;/li&gt;
&lt;li&gt;Slow trial and error&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I ask specific questions&lt;/li&gt;
&lt;li&gt;Get simplified explanations&lt;/li&gt;
&lt;li&gt;Request real examples&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Explain WordPress hooks with a real use case”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;👉 You go from confusion to clarity much faster&lt;/p&gt;

&lt;p&gt;But this leads to something important…&lt;/p&gt;


&lt;h2&gt;
  
  
  📄 Documentation Still Matters (More Than Ever)
&lt;/h2&gt;

&lt;p&gt;There’s a common misconception:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“AI replaces documentation”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It doesn’t.&lt;/p&gt;

&lt;p&gt;In my workflow, documentation is still essential —&lt;br&gt;
Sometimes even more than before.&lt;/p&gt;


&lt;h3&gt;
  
  
  🔍 Why I Still Check Documentation
&lt;/h3&gt;

&lt;p&gt;Even when I use ChatGPT, I don’t blindly trust the output.&lt;/p&gt;

&lt;p&gt;If I’m working with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WordPress hooks&lt;/li&gt;
&lt;li&gt;WooCommerce customization&lt;/li&gt;
&lt;li&gt;APIs or integrations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I always go back to documentation to confirm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are the hooks correct?&lt;/li&gt;
&lt;li&gt;Is this the recommended approach?&lt;/li&gt;
&lt;li&gt;Is there a better or more optimized way?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 Because AI can give you something that &lt;em&gt;works&lt;/em&gt;&lt;br&gt;
But not always something that’s &lt;em&gt;correct&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  ⚠️ What AI Gets Wrong
&lt;/h3&gt;

&lt;p&gt;From real experience, AI can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Suggest outdated functions&lt;/li&gt;
&lt;li&gt;Miss small but critical details&lt;/li&gt;
&lt;li&gt;Ignore performance considerations&lt;/li&gt;
&lt;li&gt;Provide solutions that don’t scale&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And if you skip documentation,&lt;br&gt;
you won’t even notice.&lt;/p&gt;


&lt;h3&gt;
  
  
  🧠 My Real Workflow (AI + Documentation)
&lt;/h3&gt;

&lt;p&gt;This is how I actually work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use AI → to get direction or a draft&lt;/li&gt;
&lt;li&gt;Review → based on my experience&lt;/li&gt;
&lt;li&gt;Check documentation → verify accuracy&lt;/li&gt;
&lt;li&gt;Improve → based on project needs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;👉 AI gives speed&lt;br&gt;
👉 Documentation gives certainty&lt;/p&gt;

&lt;p&gt;You need both.&lt;/p&gt;


&lt;h2&gt;
  
  
  🛠️ AI for Repetitive Work
&lt;/h2&gt;

&lt;p&gt;Where AI really shines isn’t complex architecture.&lt;/p&gt;

&lt;p&gt;It’s repetitive work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writing similar functions&lt;/li&gt;
&lt;li&gt;Generating variations of code&lt;/li&gt;
&lt;li&gt;Formatting data&lt;/li&gt;
&lt;li&gt;Creating dummy content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 It removes the work you don’t want to do anyway&lt;br&gt;
So you can focus on what actually matters&lt;/p&gt;


&lt;h2&gt;
  
  
  ⚠️ What AI Still Can’t Do
&lt;/h2&gt;

&lt;p&gt;AI is powerful — but it’s not reliable on its own.&lt;/p&gt;

&lt;p&gt;It doesn’t:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand your full project context&lt;/li&gt;
&lt;li&gt;Make architectural decisions&lt;/li&gt;
&lt;li&gt;Guarantee best practices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AI doesn’t replace developers — it amplifies them&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you understand the fundamentals,&lt;br&gt;
AI makes you faster and more effective.&lt;/p&gt;

&lt;p&gt;If not?&lt;/p&gt;

&lt;p&gt;It just makes mistakes faster.&lt;/p&gt;


&lt;h2&gt;
  
  
  🔥 The Real Advantage
&lt;/h2&gt;

&lt;p&gt;The developers getting real value from AI aren’t:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The ones trying every new tool&lt;/li&gt;
&lt;li&gt;Or chasing trends&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They’re the ones who:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrate AI into their workflow&lt;/li&gt;
&lt;li&gt;Ask better questions&lt;/li&gt;
&lt;li&gt;Verify and refine the output&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🧠 Final Thought
&lt;/h2&gt;

&lt;p&gt;AI tools are everywhere.&lt;/p&gt;

&lt;p&gt;But the goal isn’t to use more tools.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It’s to work smarter with the right ones.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For me, that starts with ChatGPT —&lt;br&gt;
supported by experience, and grounded in documentation.&lt;/p&gt;


&lt;h2&gt;
  
  
  👉 Want to See more AI Tools?
&lt;/h2&gt;

&lt;p&gt;🎥 Check out my youtube channel:&lt;br&gt;
 &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.youtube.com/@ClarityAIStudio" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fyt3.googleusercontent.com%2F38ifKfDd0bWcqYbZ6CmZhpA3gIi8F2z5LVSfYV6t9kfz67RPCoaSbDT8rEYg3Rb4GjiTlh89-g%3Ds900-c-k-c0x00ffffff-no-rj" height="900" class="m-0" width="900"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.youtube.com/@ClarityAIStudio" rel="noopener noreferrer" class="c-link"&gt;
            Clarity AI Studio - YouTube
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Welcome to Clarity AI Studio — where artificial intelligence is made clear, practical, and easy to use.

This channel is dedicated to breaking down complex AI tools into simple, step-by-step tutorials anyone can follow. Whether you're a student, professional, entrepreneur, or small business owner, you'll learn how to use AI to save time, boost productivity, and work smarter.

We cover:

• AI tools explained simply
• Step-by-step tutorials
• Productivity and automation workflows
• AI for small businesses and creators
• Practical use cases you can apply immediately

No hype. No complicated jargon. Just clear explanations and real-world applications.

Understand AI. Use AI. Stay ahead.

          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.youtube.com%2Fs%2Fdesktop%2Ffd6720bf%2Fimg%2Ffavicon.ico" width="16" height="16"&gt;
          youtube.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>ai</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>AI Didn’t Replace Web Developers — It Made Good Ones Stronger</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Tue, 10 Mar 2026 22:37:56 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/ai-didnt-replace-web-developers-it-made-good-ones-stronger-535p</link>
      <guid>https://dev.to/muhammadmedhat/ai-didnt-replace-web-developers-it-made-good-ones-stronger-535p</guid>
      <description>&lt;p&gt;When AI coding tools started becoming popular, a lot of predictions appeared online:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“AI will replace developers.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But after actually using these tools in real development work, something else became clear.&lt;/p&gt;

&lt;p&gt;AI didn’t replace web developers.&lt;/p&gt;

&lt;p&gt;Instead, it helped many developers become &lt;strong&gt;more productive, faster, and sometimes even better at solving problems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The real difference isn’t whether developers use AI.&lt;br&gt;
It’s &lt;strong&gt;how they use it&lt;/strong&gt;.&lt;/p&gt;


&lt;h1&gt;
  
  
  AI Works Best With Developers, Not Instead of Them
&lt;/h1&gt;

&lt;p&gt;AI can generate code, explain concepts, and suggest solutions.&lt;/p&gt;

&lt;p&gt;But it still depends on the developer to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understand the system&lt;/li&gt;
&lt;li&gt;review the generated code&lt;/li&gt;
&lt;li&gt;integrate it into a real project&lt;/li&gt;
&lt;li&gt;debug issues when things go wrong&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In practice, AI works best as &lt;strong&gt;a development assistant&lt;/strong&gt;, not a replacement.&lt;/p&gt;

&lt;p&gt;The developers who benefit the most are the ones who already understand what they’re building.&lt;/p&gt;


&lt;h1&gt;
  
  
  Real Examples From My WordPress Workflow
&lt;/h1&gt;

&lt;p&gt;In my daily WordPress development work, AI has become a useful assistant in several situations.&lt;/p&gt;

&lt;p&gt;Not as a replacement — but as something that &lt;strong&gt;removes friction from repetitive or time-consuming tasks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here are a few practical examples.&lt;/p&gt;


&lt;h2&gt;
  
  
  1. Debugging Hook Timing Issues
&lt;/h2&gt;

&lt;p&gt;Sometimes a WordPress hook doesn’t fire the way you expect.&lt;/p&gt;

&lt;p&gt;For example, a callback attached to &lt;code&gt;init&lt;/code&gt; might run too early or too late depending on what the code needs.&lt;/p&gt;

&lt;p&gt;Instead of manually searching documentation or browsing multiple threads, I can quickly ask AI something like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Why might a WordPress hook not fire as expected?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It usually suggests things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;checking hook priority&lt;/li&gt;
&lt;li&gt;verifying execution order&lt;/li&gt;
&lt;li&gt;confirming the hook exists in the current request&lt;/li&gt;
&lt;li&gt;making sure the code runs after plugins load&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It doesn’t fix the problem automatically, but it often &lt;strong&gt;points me in the right direction faster&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Generating Plugin Boilerplate
&lt;/h2&gt;

&lt;p&gt;When starting a new feature or plugin, there is always repetitive setup work.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;plugin headers&lt;/li&gt;
&lt;li&gt;basic structure&lt;/li&gt;
&lt;li&gt;registering hooks&lt;/li&gt;
&lt;li&gt;creating activation functions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of starting from an empty file every time, AI can generate a simple starting point.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a basic plugin structure&lt;/li&gt;
&lt;li&gt;a small admin settings page&lt;/li&gt;
&lt;li&gt;registering actions and filters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The generated code is rarely perfect, but it &lt;strong&gt;removes the blank-page problem&lt;/strong&gt; and speeds up the first steps.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Understanding Old or Unfamiliar Code
&lt;/h2&gt;

&lt;p&gt;WordPress developers often work with older projects or code written by other developers.&lt;/p&gt;

&lt;p&gt;Sometimes you encounter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;very long functions&lt;/li&gt;
&lt;li&gt;complex filters&lt;/li&gt;
&lt;li&gt;unusual logic&lt;/li&gt;
&lt;li&gt;legacy code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can help summarize what a piece of code is doing before you dive deeper.&lt;/p&gt;

&lt;p&gt;For example, asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What does this function do?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This doesn’t replace reading the code, but it helps &lt;strong&gt;understand the context faster&lt;/strong&gt;, especially in large codebases.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. Exploring Alternative Implementations
&lt;/h2&gt;

&lt;p&gt;Sometimes a solution works, but you still want to check if there’s a &lt;strong&gt;cleaner or more efficient approach&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;alternative ways to structure a WordPress plugin&lt;/li&gt;
&lt;li&gt;different ways to filter a query&lt;/li&gt;
&lt;li&gt;optimizing loops or database queries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI can generate alternative ideas quickly.&lt;/p&gt;

&lt;p&gt;The developer still decides what to keep, but it helps &lt;strong&gt;explore options faster&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  5. Testing Small Ideas Quickly
&lt;/h2&gt;

&lt;p&gt;For quick experiments, I often test ideas using &lt;strong&gt;WP-CLI&lt;/strong&gt;.&lt;br&gt;
you can read articles about &lt;a href="https://dev.to/muhammadmedhat/simple-wp-cli-commands-that-make-wordpress-easier-1cko"&gt;Simple WP-CLI Commands&lt;/a&gt; for more info&lt;/p&gt;

&lt;p&gt;For example, triggering hooks directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s1"&gt;'do_action("my_plugin_custom_hook");'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI can help quickly draft small snippets for things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;temporary debugging code&lt;/li&gt;
&lt;li&gt;logging hooks&lt;/li&gt;
&lt;li&gt;small PHP checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes it easier to &lt;strong&gt;experiment without interrupting the development flow&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Real Skill That Matters
&lt;/h1&gt;

&lt;p&gt;AI becomes most useful when developers already understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;programming fundamentals&lt;/li&gt;
&lt;li&gt;debugging&lt;/li&gt;
&lt;li&gt;system architecture&lt;/li&gt;
&lt;li&gt;performance considerations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without those skills, AI-generated code can be confusing or even harmful.&lt;/p&gt;

&lt;p&gt;But with strong fundamentals, AI becomes a &lt;strong&gt;force multiplier&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It removes repetitive work and allows developers to focus more on solving real problems.&lt;/p&gt;




&lt;h1&gt;
  
  
  How AI Is Actually Changing Development
&lt;/h1&gt;

&lt;p&gt;AI is definitely changing the development workflow.&lt;/p&gt;

&lt;p&gt;Tasks that once required long searches through documentation can now happen much faster:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;generating boilerplate code&lt;/li&gt;
&lt;li&gt;explaining unfamiliar syntax&lt;/li&gt;
&lt;li&gt;suggesting debugging steps&lt;/li&gt;
&lt;li&gt;exploring implementation ideas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the developer still remains responsible for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understanding the problem&lt;/li&gt;
&lt;li&gt;making technical decisions&lt;/li&gt;
&lt;li&gt;reviewing generated code&lt;/li&gt;
&lt;li&gt;maintaining the system long-term&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI speeds up development — it doesn’t replace the thinking behind it.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;AI didn’t eliminate the need for web developers.&lt;/p&gt;

&lt;p&gt;Instead, it became another powerful tool in the development toolbox.&lt;/p&gt;

&lt;p&gt;Developers who learn how to use it effectively can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;work faster&lt;/li&gt;
&lt;li&gt;experiment more&lt;/li&gt;
&lt;li&gt;reduce repetitive tasks&lt;/li&gt;
&lt;li&gt;focus more on real problem solving&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end, AI doesn’t replace developers.&lt;/p&gt;

&lt;p&gt;It helps the ones who adapt become &lt;strong&gt;stronger and more productive&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>wordpress</category>
      <category>php</category>
    </item>
    <item>
      <title>Understanding WordPress Execution Order (Who Runs First and Why Your Code Fails Sometimes)</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Wed, 11 Feb 2026 22:23:19 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/understanding-wordpress-execution-order-who-runs-first-and-why-your-code-fails-sometimes-487l</link>
      <guid>https://dev.to/muhammadmedhat/understanding-wordpress-execution-order-who-runs-first-and-why-your-code-fails-sometimes-487l</guid>
      <description>&lt;p&gt;A lot of WordPress “bugs” are not really bugs.&lt;/p&gt;

&lt;p&gt;They’re this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“My code is fine, but it’s running at the wrong time.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you understand &lt;strong&gt;when&lt;/strong&gt; WordPress loads plugins, themes, and hooks, you can avoid a huge class of problems: things not showing, filters not firing, or options not being available yet.&lt;/p&gt;

&lt;p&gt;This article walks through &lt;strong&gt;execution order in a practical way&lt;/strong&gt;, with real hooks and examples.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Big Picture: What Loads First?
&lt;/h2&gt;

&lt;p&gt;When a page loads in WordPress, this is (roughly) what happens:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WordPress core boots up&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Must-use plugins (mu-plugins)&lt;/strong&gt; load&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regular plugins&lt;/strong&gt; load&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;current theme&lt;/strong&gt; loads&lt;/li&gt;
&lt;li&gt;Important &lt;strong&gt;core hooks&lt;/strong&gt; fire (like &lt;code&gt;init&lt;/code&gt;, &lt;code&gt;wp_loaded&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;template&lt;/strong&gt; is chosen and rendered&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You don’t need to memorize every internal step, but you do need one key idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If your code depends on something, make sure it runs &lt;em&gt;after&lt;/em&gt; that thing is loaded.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  2. Key Hooks in the Early Lifecycle
&lt;/h2&gt;

&lt;p&gt;Let’s look at a few hooks you’ll see all the time, and what they’re good for.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;plugins_loaded&lt;/code&gt;
&lt;/h3&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;'plugins_loaded'&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;// Check if other plugins are active&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When it fires:&lt;/strong&gt;&lt;br&gt;
After all active plugins have been loaded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your plugin depends on another plugin (e.g. WooCommerce, ACF)&lt;/li&gt;
&lt;li&gt;You want to check if a plugin is active before using its functions&lt;/li&gt;
&lt;li&gt;You’re writing compatibility code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&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;'plugins_loaded'&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nb"&gt;class_exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'WooCommerce'&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="c1"&gt;// Safe to run WooCommerce-related 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;h3&gt;
  
  
  &lt;code&gt;init&lt;/code&gt;
&lt;/h3&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;'init'&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;// Register CPTs, taxonomies, etc.&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When it fires:&lt;/strong&gt;&lt;br&gt;
After WordPress is loaded, but before any headers are sent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Registering &lt;strong&gt;Custom Post Types&lt;/strong&gt; and &lt;strong&gt;taxonomies&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Adding rewrite rules&lt;/li&gt;
&lt;li&gt;Setting up things that must be ready early in the request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is one of the most commonly used hooks in WordPress.&lt;/p&gt;


&lt;h3&gt;
  
  
  &lt;code&gt;wp_loaded&lt;/code&gt;
&lt;/h3&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_loaded'&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;// Code that needs everything initialized&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When it fires:&lt;/strong&gt;&lt;br&gt;
After WordPress, plugins, and the theme have all been loaded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;init&lt;/code&gt; is too early for what you’re doing&lt;/li&gt;
&lt;li&gt;You need &lt;em&gt;everything&lt;/em&gt; available before your code runs&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  3. Theme-Specific Hooks
&lt;/h2&gt;

&lt;p&gt;When you’re working on themes (or plugins that depend on theme behavior), these hooks matter a lot.&lt;/p&gt;


&lt;h3&gt;
  
  
  &lt;code&gt;after_setup_theme&lt;/code&gt;
&lt;/h3&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;'after_setup_theme'&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;add_theme_support&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'post-thumbnails'&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;&lt;strong&gt;When it fires:&lt;/strong&gt;&lt;br&gt;
Right after the active theme is loaded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding &lt;code&gt;add_theme_support()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Registering nav menus&lt;/li&gt;
&lt;li&gt;Doing high-level theme setup&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  &lt;code&gt;wp_enqueue_scripts&lt;/code&gt;
&lt;/h3&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_enqueue_style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'my-theme'&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="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;&lt;strong&gt;When it fires:&lt;/strong&gt;&lt;br&gt;
When WordPress is ready to enqueue scripts and styles for the frontend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enqueuing CSS and JS files for your theme or plugin&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your styles/scripts aren’t loading or are in the wrong place, check if you’re using this hook correctly.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. Hook Priority: Same Hook, Different Order
&lt;/h2&gt;

&lt;p&gt;Sometimes you hook into the &lt;strong&gt;same hook&lt;/strong&gt; as someone else, but you still need to control &lt;em&gt;who runs first&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That’s where priority comes in.&lt;/p&gt;

&lt;p&gt;Default priority is &lt;code&gt;10&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;'init'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'my_function'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;           &lt;span class="c1"&gt;// priority 10&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;'init'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'my_other_function'&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;span class="c1"&gt;// priority 20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lower = earlier. Higher = later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&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;'init'&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="nb"&gt;error_log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'I run first'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;5&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;'init'&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="nb"&gt;error_log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'I run second'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When you care about priority:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want to &lt;strong&gt;override&lt;/strong&gt; something another plugin or theme did&lt;/li&gt;
&lt;li&gt;You need to &lt;strong&gt;modify data after someone else touched it&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You want to make sure your code &lt;strong&gt;doesn’t run too early&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Common “Execution Order” Problems (and Why They Happen)
&lt;/h2&gt;

&lt;p&gt;Let’s connect this to real-life issues you’ve probably seen.&lt;/p&gt;




&lt;h3&gt;
  
  
  Problem 1: “My Custom Post Type 404s”
&lt;/h3&gt;

&lt;p&gt;You:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Register a CPT somewhere random (like at the bottom of &lt;code&gt;functions.php&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Visit the CPT archive and get a 404&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Likely cause:&lt;/strong&gt;&lt;br&gt;
CPT is not registered on &lt;code&gt;init&lt;/code&gt; (or not on every request), so rewrite rules and queries don’t know about it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&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;'init'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'register_books_cpt'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Problem 2: “I’m Getting ‘Call to undefined function’ From Another Plugin”
&lt;/h3&gt;

&lt;p&gt;You:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Call a function from WooCommerce or another plugin&lt;/li&gt;
&lt;li&gt;Code runs too early&lt;/li&gt;
&lt;li&gt;Function doesn’t exist yet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Likely cause:&lt;/strong&gt;&lt;br&gt;
You are running before &lt;code&gt;plugins_loaded&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&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;'plugins_loaded'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'my_plugin_compat'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Problem 3: “My Script Isn’t Loading Where I Expect”
&lt;/h3&gt;

&lt;p&gt;You:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;wp_enqueue_script()&lt;/code&gt; directly in &lt;code&gt;functions.php&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;It loads in weird places, or not at all&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Likely cause:&lt;/strong&gt;&lt;br&gt;
Scripts are not enqueued on &lt;code&gt;wp_enqueue_scripts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&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_enqueue_scripts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'my_theme_assets'&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. A Simple Mental Model
&lt;/h2&gt;

&lt;p&gt;You don’t need to memorize every hook, but this mental model helps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Core boots
↓
Plugins load      (plugins_loaded)
↓
Theme loads       (after_setup_theme)
↓
WordPress “ready” (init, wp_loaded)
↓
Assets phase      (wp_enqueue_scripts)
↓
Template chosen   (template_redirect, etc.)
↓
Page output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ask yourself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“At this point in the timeline, does what I need already exist?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If not, you’re probably on the wrong hook.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Quick Debugging Techniques
&lt;/h2&gt;

&lt;p&gt;When something doesn’t work, instead of only checking your logic, check your &lt;strong&gt;timing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A few easy tricks:&lt;/p&gt;

&lt;h3&gt;
  
  
  1) Log when a hook fires
&lt;/h3&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;'init'&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="nb"&gt;error_log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s1"&gt;'init fired'&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;Check &lt;code&gt;wp-content/debug.log&lt;/code&gt; to confirm.&lt;/p&gt;




&lt;h3&gt;
  
  
  2) Temporarily change hooks
&lt;/h3&gt;

&lt;p&gt;Try moving your code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;from &lt;code&gt;init&lt;/code&gt; → &lt;code&gt;wp_loaded&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;from constructor → &lt;code&gt;init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;from random place → &lt;code&gt;plugins_loaded&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it starts working, your problem was timing, not code.&lt;/p&gt;




&lt;h3&gt;
  
  
  3) Dump the call stack (for deeper debugging)
&lt;/h3&gt;

&lt;p&gt;If you’re more advanced, tools like Xdebug or &lt;code&gt;debug_backtrace()&lt;/code&gt; help you see &lt;strong&gt;how&lt;/strong&gt; you got to a certain hook.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Understanding &lt;strong&gt;when&lt;/strong&gt; WordPress runs your code is one of those skills that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prevents subtle bugs&lt;/li&gt;
&lt;li&gt;makes debugging less painful&lt;/li&gt;
&lt;li&gt;helps you work better with other plugins and themes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After a while, you’ll stop thinking “WordPress is weird” and start thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Ah, my code is just running too early / too late.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s a much easier problem to fix.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>wphooks</category>
      <category>php</category>
    </item>
    <item>
      <title>Simple WP-CLI Commands That Make WordPress Easier</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Sat, 17 Jan 2026 16:44:03 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/simple-wp-cli-commands-that-make-wordpress-easier-1cko</link>
      <guid>https://dev.to/muhammadmedhat/simple-wp-cli-commands-that-make-wordpress-easier-1cko</guid>
      <description>&lt;p&gt;WP-CLI isn’t just for advanced developers.&lt;br&gt;
Even for &lt;strong&gt;basic WordPress tasks&lt;/strong&gt;, it can save time and reduce a lot of clicking around in the dashboard.&lt;/p&gt;

&lt;p&gt;If you already know what WP-CLI is and how to install it, here are &lt;strong&gt;simple, everyday commands&lt;/strong&gt; I use to manage WordPress sites faster.&lt;/p&gt;


&lt;h2&gt;
  
  
  1) Check Basic Site Info (First Thing I Run)
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp option get siteurl
wp option get home
wp core version
wp user list &lt;span class="nt"&gt;--fields&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ID,user_login,roles
wp theme list &lt;span class="nt"&gt;--status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;active
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
Right after connecting to a server, or before doing any changes.&lt;/p&gt;

&lt;p&gt;Why:&lt;br&gt;
This gives you a quick picture of the site without opening wp-admin:&lt;/p&gt;

&lt;p&gt;Which site URL you’re on&lt;/p&gt;

&lt;p&gt;Which WordPress version is running&lt;/p&gt;

&lt;p&gt;Who the users are (and their roles)&lt;/p&gt;

&lt;p&gt;Which theme is active&lt;/p&gt;
&lt;h2&gt;
  
  
  It’s an easy way to make sure you’re in the right place and understand the setup before touching anything.
&lt;/h2&gt;
&lt;h2&gt;
  
  
  2) See Active Plugins
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp plugin list &lt;span class="nt"&gt;--status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;active
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
When a site is slow or acting weird and you want to know what’s running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Much faster than opening the Plugins page in wp-admin.&lt;/p&gt;


&lt;h2&gt;
  
  
  3) Disable or Enable a Plugin
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp plugin deactivate plugin-slug
wp plugin activate plugin-slug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
A plugin causes errors, white screens, or conflicts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
You can fix problems even if wp-admin is broken.&lt;/p&gt;


&lt;h2&gt;
  
  
  4) Update WordPress Core
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp core update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
WordPress shows an update notification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
It’s quick, reliable, and avoids browser timeouts.&lt;/p&gt;


&lt;h2&gt;
  
  
  5) Update Plugins and Themes
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp plugin update &lt;span class="nt"&gt;--all&lt;/span&gt;
wp theme update &lt;span class="nt"&gt;--all&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
Doing regular maintenance or security updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
One command replaces many clicks.&lt;/p&gt;


&lt;h2&gt;
  
  
  6) Fix Permalink Problems
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp rewrite flush &lt;span class="nt"&gt;--hard&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
Pages suddenly show 404 errors after changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Same as re-saving permalinks in settings, just faster.&lt;/p&gt;


&lt;h2&gt;
  
  
  7) Clear Cached Data
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp transient delete &lt;span class="nt"&gt;--all&lt;/span&gt;
wp cache flush
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
You changed something but the site still shows old data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Clears temporary stored values that cause confusion.&lt;/p&gt;


&lt;h2&gt;
  
  
  8) Enable Maintenance Mode
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp maintenance-mode activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Disable it when finished:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp maintenance-mode deactivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
Making quick updates or small migrations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Stops visitors from seeing half-finished changes.&lt;/p&gt;


&lt;h2&gt;
  
  
  9) Create a New User
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp user create editor1 editor@example.com &lt;span class="nt"&gt;--role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;editor &lt;span class="nt"&gt;--user_pass&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'Password123'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
You need to add a user quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
No forms, no waiting for email confirmations.&lt;/p&gt;


&lt;h2&gt;
  
  
  10) Reset a User Password
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp user update editor1 &lt;span class="nt"&gt;--user_pass&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'NewPassword123'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
Someone can’t log in and email isn’t working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Instant fix without touching wp-admin.&lt;/p&gt;


&lt;h2&gt;
  
  
  11) List Pages or Posts
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp post list &lt;span class="nt"&gt;--post_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
You want a quick overview of site content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Faster than browsing multiple admin screens.&lt;/p&gt;


&lt;h2&gt;
  
  
  12) List Media Files (Attachments)
&lt;/h2&gt;

&lt;p&gt;Media files in WordPress are stored as &lt;strong&gt;attachments&lt;/strong&gt;, so you list them like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp post list &lt;span class="nt"&gt;--post_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;attachment &lt;span class="nt"&gt;--fields&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ID,post_title,guid &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
After a migration or when uploads look wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Gives you a clear list of media without opening the Media Library.&lt;/p&gt;




&lt;h2&gt;
  
  
  Important Note About &lt;code&gt;wp media&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;You &lt;strong&gt;can’t use &lt;code&gt;wp media list&lt;/code&gt;&lt;/strong&gt; to list uploads.&lt;br&gt;
That command does &lt;strong&gt;not exist&lt;/strong&gt; in core WP-CLI.&lt;/p&gt;

&lt;p&gt;👉 To &lt;em&gt;list&lt;/em&gt; media → use &lt;strong&gt;attachments&lt;/strong&gt; with &lt;code&gt;wp post&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;However, &lt;code&gt;wp media&lt;/code&gt; &lt;strong&gt;is still very useful&lt;/strong&gt; for managing media files.&lt;/p&gt;




&lt;h3&gt;
  
  
  Useful &lt;code&gt;wp media&lt;/code&gt; Subcommands
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fix image rotation&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  wp media fix-orientation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;When:&lt;/em&gt; Images look rotated after upload&lt;br&gt;
  &lt;em&gt;Why:&lt;/em&gt; Automatically fixes orientation metadata&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;See registered image sizes&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  wp media image-size
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;When:&lt;/em&gt; You want to know which image sizes WordPress uses&lt;br&gt;
  &lt;em&gt;Why:&lt;/em&gt; Helpful when working with themes or performance&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Import media files&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  wp media import image.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;When:&lt;/em&gt; Uploading files in bulk or migrating content&lt;br&gt;
  &lt;em&gt;Why:&lt;/em&gt; Faster than uploading through the browser&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Regenerate thumbnails&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  wp media regenerate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;When:&lt;/em&gt; After changing image sizes or switching themes&lt;br&gt;
  &lt;em&gt;Why:&lt;/em&gt; Ensures images match the new settings&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Easy way to remember:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;List media → &lt;code&gt;wp post&lt;/code&gt; (attachments)&lt;br&gt;
Manage media → &lt;code&gt;wp media&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  13) Quick Search &amp;amp; Replace (Safe Way)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp search-replace &lt;span class="s1"&gt;'http://oldsite.com'&lt;/span&gt; &lt;span class="s1"&gt;'https://newsite.com'&lt;/span&gt; &lt;span class="nt"&gt;--dry-run&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
After moving a site or changing domains.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Safely updates links without breaking data.&lt;br&gt;
Always run with &lt;code&gt;--dry-run&lt;/code&gt; first.&lt;/p&gt;




&lt;h2&gt;
  
  
  14) Check WordPress Core Files
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp core verify-checksums
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
Something feels broken or suspicious.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Confirms WordPress core files are clean and unchanged.&lt;/p&gt;




&lt;h2&gt;
  
  
  15) Run a Small One-Time Check
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wp &lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s1"&gt;'echo get_bloginfo("name");'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to use it:&lt;/strong&gt;&lt;br&gt;
You just want to check or tweak something quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why:&lt;/strong&gt;&lt;br&gt;
Lets you use WordPress functions without editing files.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Small Note on Custom Post Types
&lt;/h2&gt;

&lt;p&gt;I often use WP-CLI for Custom Post Types too, mainly to keep things fast and consistent. I’ll cover that workflow in a separate article.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;WP-CLI isn’t only for advanced developers.&lt;br&gt;
Even &lt;strong&gt;simple tasks&lt;/strong&gt;—updates, users, plugins, media—are easier once you get used to it.&lt;/p&gt;

&lt;p&gt;If you already know WordPress, WP-CLI is just another tool that makes daily work smoother and less annoying.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please check this article &lt;a href="https://dev.to/muhammadmedhat/getting-started-with-wp-cli-a-powerful-tool-for-wordpress-developers-50ea" rel="noopener noreferrer"&gt;Getting Started with WP-CLI&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>beginners</category>
      <category>cli</category>
      <category>productivity</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>The Classic WordPress Template Hierarchy — The Map Behind Every Theme</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Sun, 26 Oct 2025 12:32:34 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/the-classic-wordpress-template-hierarchy-the-map-behind-every-them-3pbj</link>
      <guid>https://dev.to/muhammadmedhat/the-classic-wordpress-template-hierarchy-the-map-behind-every-them-3pbj</guid>
      <description>&lt;h2&gt;
  
  
  The Classic WordPress Template Hierarchy — Explained Like a Map
&lt;/h2&gt;

&lt;p&gt;When you open a page on a WordPress site, you might think the system just “loads the right file.”&lt;br&gt;
But behind the scenes, something much more elegant happens — a logical treasure hunt called the &lt;strong&gt;Template Hierarchy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This hierarchy is the backbone of every classic (PHP-based) WordPress theme. It determines which template file WordPress will use to display a certain type of content — from a blog post to a category archive, to that friendly (or not so friendly) &lt;em&gt;404&lt;/em&gt; page.&lt;/p&gt;

&lt;p&gt;Let’s take a walk through that map — step by step — and see how WordPress decides what to load.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Is the Template Hierarchy?
&lt;/h2&gt;

&lt;p&gt;When a visitor requests a page, WordPress does three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Queries the database&lt;/strong&gt; to determine what’s being requested (a post, a category, a page, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Builds a prioritized list&lt;/strong&gt; of possible template files based on that type of request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Loads the first template file that exists&lt;/strong&gt; in your active theme directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If nothing more specific is found, WordPress gracefully falls back to the ultimate safety net: &lt;code&gt;index.php&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Think of it as WordPress saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Do we have something specific for this? No? Okay, something more general? Still no? Alright then, use &lt;code&gt;index.php&lt;/code&gt; and show &lt;em&gt;something!&lt;/em&gt;”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s the beauty of the system — &lt;strong&gt;it never breaks&lt;/strong&gt;, it just gets simpler.&lt;/p&gt;


&lt;h2&gt;
  
  
  1. Front Page and Home
&lt;/h2&gt;

&lt;p&gt;Your homepage behavior depends on what you’ve set in &lt;strong&gt;Settings → Reading&lt;/strong&gt;:&lt;/p&gt;
&lt;h3&gt;
  
  
  If “Your latest posts” is selected:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;home.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  If “A static page” is selected:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;front-page.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If a page is assigned as “Posts Page”: &lt;code&gt;home.php&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Fallback: &lt;code&gt;index.php&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;front-page.php&lt;/code&gt; → Always highest priority for the site front page.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;home.php&lt;/code&gt; → The blog posts listing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;index.php&lt;/code&gt; → The safety net.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/#front-page-display" rel="noopener noreferrer"&gt;Reference – Front Page Display&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Single Posts and Custom Post Types
&lt;/h2&gt;

&lt;p&gt;Whenever you open a single post, WordPress looks for templates in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;single-{post_type}-{slug}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;single-{post_type}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;single.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;singular.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
If you have a custom post type called &lt;code&gt;movie&lt;/code&gt; and the post slug is &lt;code&gt;inception&lt;/code&gt;, WordPress will try:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;single-movie-inception.php
→ single-movie.php
→ single.php
→ singular.php
→ index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post" rel="noopener noreferrer"&gt;Reference – Single Post Templates&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Pages (Static Pages)
&lt;/h2&gt;

&lt;p&gt;Pages have their own neat system because they can use &lt;strong&gt;custom templates&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Order of lookup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Template selected in the Page Editor (&lt;code&gt;Template Name:&lt;/code&gt; in file header)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;page-{slug}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;page-{id}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;page.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;singular.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example: for a page titled &lt;strong&gt;About Us&lt;/strong&gt;, with slug &lt;code&gt;about&lt;/code&gt;, the chain might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;page-about.php
→ page-42.php
→ page.php
→ singular.php
→ index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/#page" rel="noopener noreferrer"&gt;Reference – Page Templates&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Archives: Categories, Tags, Custom Taxonomies
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Category Archive
&lt;/h3&gt;

&lt;p&gt;When browsing a category archive (like &lt;code&gt;/category/news&lt;/code&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;category-{slug}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;category-{id}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;category.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;archive.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Tag Archive
&lt;/h3&gt;

&lt;p&gt;For tags, it’s similar:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;tag-{slug}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tag-{id}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tag.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;archive.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Custom Taxonomies
&lt;/h3&gt;

&lt;p&gt;If you’ve registered a custom taxonomy (say &lt;code&gt;genre&lt;/code&gt; for books):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;taxonomy-{taxonomy}-{term}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;taxonomy-{taxonomy}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;taxonomy.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;archive.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/#custom-taxonomies" rel="noopener noreferrer"&gt;Reference – Category, Tag &amp;amp; Taxonomy Templates&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Author, Date, and Other Archives
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Author Archives
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;author-{nicename}.php
→ author-{id}.php
→ author.php
→ archive.php
→ index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Date Archives
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;date.php
→ archive.php
→ index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Other archives (post type archives, search results, etc.) follow a similar pattern.&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/#author-and-date" rel="noopener noreferrer"&gt;Reference – Author and Date Archives&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Search and 404 Templates
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Search Results
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;search.php
→ index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  404 (Not Found)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;404.php
→ index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A well-designed &lt;code&gt;404.php&lt;/code&gt; can turn a dead-end into a friendly nudge — or even a chance to show helpful links or your site map.&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/#special-templates" rel="noopener noreferrer"&gt;Reference – Special Templates&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Attachments and Comments
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Attachments (media items)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;attachment-{mime_type}.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;attachment.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;single-attachment.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;single.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Comments Template&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;comments.php&lt;/code&gt; is included inside your templates via &lt;code&gt;comments_template()&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/#attachment" rel="noopener noreferrer"&gt;Reference – Attachments&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Child Themes and Overrides
&lt;/h2&gt;

&lt;p&gt;When using a &lt;strong&gt;child theme&lt;/strong&gt;, the lookup happens twice — once in the child, then in the parent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WordPress first checks the &lt;strong&gt;child theme&lt;/strong&gt; for the requested file.&lt;/li&gt;
&lt;li&gt;If it doesn’t exist there, it falls back to the &lt;strong&gt;parent theme&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/wp-content/themes/my-child-theme/single.php
→ /wp-content/themes/my-parent-theme/single.php
→ index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s why child themes are the perfect way to modify templates safely — without breaking or overwriting parent theme updates.&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://developer.wordpress.org/themes/advanced-topics/child-themes/" rel="noopener noreferrer"&gt;Reference – Child Themes&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Why This Hierarchy Is Brilliant
&lt;/h2&gt;

&lt;p&gt;The hierarchy makes WordPress:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Predictable&lt;/strong&gt; — You always know where to put your custom template.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexible&lt;/strong&gt; — You can override only what you need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fail-safe&lt;/strong&gt; — It always falls back to &lt;code&gt;index.php&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readable&lt;/strong&gt; — Anyone who understands the hierarchy can quickly read a theme’s structure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s like a well-thought-out decision tree that keeps WordPress adaptable without chaos.&lt;/p&gt;




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

&lt;p&gt;The WordPress Template Hierarchy is not just a technical system — it’s &lt;em&gt;design philosophy in code form&lt;/em&gt;.&lt;br&gt;
It rewards organization, clarity, and foresight. Once you understand it, you gain full control over how every pixel of your site is displayed.&lt;/p&gt;

&lt;p&gt;In the next article, we’ll explore how this hierarchy evolves in the &lt;strong&gt;Block Theme / Full Site Editing (FSE)&lt;/strong&gt; era — and what remains timeless.&lt;/p&gt;




&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.wordpress.org/themes/basics/template-hierarchy/" rel="noopener noreferrer"&gt;Template Hierarchy – WordPress Developer Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://digwp.com/2010/09/wordpress-3-template-hierarchy/" rel="noopener noreferrer"&gt;DigWP – WordPress 3 Template Hierarchy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wpshout.com/wordpress-template-hierarchy/" rel="noopener noreferrer"&gt;WPShout – WordPress Template Hierarchy Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kinsta.com/blog/wordpress-template-hierarchy/" rel="noopener noreferrer"&gt;Kinsta – WordPress Template Hierarchy Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.wordpress.org/themes/advanced-topics/child-themes/" rel="noopener noreferrer"&gt;WordPress Codex – Child Themes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>php</category>
    </item>
    <item>
      <title>Common WordPress Mistakes New Developers Make and How to Avoid Them</title>
      <dc:creator>Muhammad Medhat</dc:creator>
      <pubDate>Fri, 22 Aug 2025 14:47:12 +0000</pubDate>
      <link>https://dev.to/muhammadmedhat/common-wordpress-mistakes-new-developers-make-and-how-to-avoid-them-19ci</link>
      <guid>https://dev.to/muhammadmedhat/common-wordpress-mistakes-new-developers-make-and-how-to-avoid-them-19ci</guid>
      <description>&lt;p&gt;WordPress is one of the most popular content management systems in the world, powering over 40% of websites. While it’s beginner-friendly, new developers often make mistakes that can cause performance issues, security vulnerabilities, or maintenance headaches down the road.&lt;/p&gt;

&lt;p&gt;In this article, we’ll cover the most common mistakes beginners make in WordPress development — and how you can avoid them to build faster, safer, and more maintainable websites.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Ignoring WordPress Coding Standards
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Writing PHP, HTML, CSS, or JavaScript without following WordPress coding standards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Makes your code hard to read and maintain.&lt;/li&gt;
&lt;li&gt;Other developers may struggle to understand your work.&lt;/li&gt;
&lt;li&gt;Increases the risk of errors and bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;br&gt;
Follow the official &lt;a href="https://developer.wordpress.org/coding-standards/" rel="noopener noreferrer"&gt;WordPress Coding Standards&lt;/a&gt;. You can also integrate tools like &lt;strong&gt;PHPCS&lt;/strong&gt; into your development workflow to automatically enforce them.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Not Using Version Control (like Git)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Building entire websites without Git or any version control system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No backup of your changes.&lt;/li&gt;
&lt;li&gt;Difficult to collaborate with a team.&lt;/li&gt;
&lt;li&gt;Impossible to roll back safely if something breaks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;br&gt;
Learn Git basics and use platforms like GitHub, GitLab, or Bitbucket. Even if you’re working alone, version control will save you from countless headaches.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Hardcoding URLs and File Paths
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Writing URLs directly into your templates or functions (e.g., &lt;code&gt;https://example.com/images/logo.png&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Moving the site to another domain or staging environment becomes painful.&lt;/li&gt;
&lt;li&gt;Breaks your site during migrations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;br&gt;
Always use WordPress functions like:&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="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nf"&gt;get_template_directory_uri&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nf"&gt;home_url&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These functions keep your site flexible and migration-friendly.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Ignoring Security Best Practices
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Leaving the default “admin” username, weak passwords, or not updating plugins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WordPress sites are common targets for hackers.&lt;/li&gt;
&lt;li&gt;Weak security can lead to malware, spam, or data theft.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always change the default admin username.&lt;/li&gt;
&lt;li&gt;Use strong passwords and two-factor authentication.&lt;/li&gt;
&lt;li&gt;Keep themes, plugins, and WordPress core updated.&lt;/li&gt;
&lt;li&gt;Use a reputable security plugin like Wordfence or Sucuri.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Forgetting to Optimize Performance
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Installing too many plugins, uploading uncompressed images, and ignoring caching.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slow websites drive visitors away.&lt;/li&gt;
&lt;li&gt;Poor performance affects SEO rankings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimize plugin usage — only keep what’s necessary.&lt;/li&gt;
&lt;li&gt;Compress images using tools like TinyPNG or plugins like Smush.&lt;/li&gt;
&lt;li&gt;Use caching plugins such as WP Rocket or LiteSpeed Cache.&lt;/li&gt;
&lt;li&gt;Implement a CDN (Content Delivery Network) if possible.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6. Editing Core WordPress Files
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Modifying WordPress core files to change functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your changes will be wiped out on updates.&lt;/li&gt;
&lt;li&gt;Can break the site or introduce security holes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;br&gt;
Never edit WordPress core files. If you need to extend or modify functionality, use hooks (actions and filters) or custom plugins.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Poor Database Management
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Not cleaning up unused tables, revisions, or testing queries directly in the live database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Leads to bloated databases and slow queries.&lt;/li&gt;
&lt;li&gt;Increases chances of breaking the site.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Regularly optimize your database using plugins like WP-Optimize.&lt;/li&gt;
&lt;li&gt;Always back up your database before making changes.&lt;/li&gt;
&lt;li&gt;For testing queries, use a local environment or staging site, not production.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  8. Not Using a Child Theme
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Editing a parent theme’s files directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All changes will be lost once the theme is updated.&lt;/li&gt;
&lt;li&gt;Maintaining and debugging becomes very difficult.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;br&gt;
Always create a &lt;strong&gt;child theme&lt;/strong&gt; before making modifications. This way, you can safely update the parent theme while keeping your customizations intact. Here’s &lt;a href="https://developer.wordpress.org/themes/advanced-topics/child-themes/" rel="noopener noreferrer"&gt;WordPress’s guide on child themes&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Skipping Regular Backups
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The mistake:&lt;/strong&gt; Relying on “hoping nothing breaks” instead of real backups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sites can break during updates.&lt;/li&gt;
&lt;li&gt;Hosting problems, hacks, or human mistakes can cause data loss.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to fix:&lt;/strong&gt;&lt;br&gt;
Always schedule automatic backups. Use plugins like UpdraftPlus or rely on your hosting provider’s built-in backup solutions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Advice: Choose Managed Hosting
&lt;/h2&gt;

&lt;p&gt;One of the smartest moves for new developers is to use &lt;strong&gt;WordPress managed hosting&lt;/strong&gt;. With managed hosting, you get built-in performance optimization, advanced security, and automatic backups.&lt;/p&gt;

&lt;p&gt;Most providers also offer &lt;strong&gt;their own caching and backup plugins&lt;/strong&gt;, which are usually better integrated and more reliable than third-party options. By using them, you avoid plugin conflicts and ensure your site stays secure and fast.&lt;/p&gt;




&lt;p&gt;✅ By avoiding these mistakes, using child themes, and relying on managed hosting with built-in tools, you’ll save yourself countless hours of troubleshooting — and ensure your WordPress projects are professional, scalable, and easy to maintain.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>programming</category>
      <category>seo</category>
    </item>
  </channel>
</rss>
