<?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: Kushal Pathak</title>
    <description>The latest articles on DEV Community by Kushal Pathak (@kushal_pathak).</description>
    <link>https://dev.to/kushal_pathak</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%2F4202250%2Ff7c80f06-3237-486c-9eb9-e9eb40493cbd.jpg</url>
      <title>DEV Community: Kushal Pathak</title>
      <link>https://dev.to/kushal_pathak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kushal_pathak"/>
    <language>en</language>
    <item>
      <title>Cutting trial-checkout abandonment on a subscription SaaS (61% to 68.5%)</title>
      <dc:creator>Kushal Pathak</dc:creator>
      <pubDate>Wed, 18 Nov 2026 15:30:31 +0000</pubDate>
      <link>https://dev.to/kushal_pathak/cutting-trial-checkout-abandonment-on-a-subscription-saas-61-to-685-4m40</link>
      <guid>https://dev.to/kushal_pathak/cutting-trial-checkout-abandonment-on-a-subscription-saas-61-to-685-4m40</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F062ll1od1c0e4l20biri.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F062ll1od1c0e4l20biri.jpg" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;br&gt;
The whole fix in one picture: a $0 trial that asked for about ten fields, cut to three or one click.&lt;/p&gt;

&lt;p&gt;The funnel already worked. Organic traffic was healthy and a steady trickle of trials converted every week. The problem sat at the very end: of the people who actually began the trial checkout, a large share never finished. No new traffic, no price change, no product rebuild was needed. The friction was almost entirely in the form itself, and most of it was a setting that could be switched off.&lt;/p&gt;

&lt;p&gt;The context&lt;br&gt;
The client runs a subscription apparel-mockup platform: users browse a large library of garment mockups, drop their own artwork onto a blank, and export a high-resolution product image. It is monetised with a 7-day free trial that rolls into a monthly plan, built on WordPress with MemberPress handling membership and checkout, and Stripe and PayPal as the payment gateways.&lt;/p&gt;

&lt;p&gt;What I set out to achieve&lt;br&gt;
One focused goal: lift the rate at which people who start the trial checkout actually complete it. No new traffic, no price change, no product rebuild. Just remove whatever was making ready-to-sign-up users give up at the form.&lt;/p&gt;

&lt;p&gt;What I did&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Measured the leak in GA4 before touching anything&lt;br&gt;
I built the checkout funnel from the GA4 event stream, comparing checkout-start events against completed-purchase events. The gap was stark: roughly 39% of people who began checkout abandoned before finishing, and the subscribe page itself had an engagement rate of only 16%, the lowest of any key page. That told me the problem was the checkout surface, not the traffic reaching it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Audited the live checkout field by field&lt;br&gt;
To start a $0 trial, the form asked for about ten inputs: email, password, confirm password, then a full billing address (name, two address lines, city, country, state, postcode), and finally card or PayPal. There was no Google or social signup. Asking someone to type a full postal address and invent a password to begin a free trial is a textbook abandonment driver, and the data agreed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Traced the friction to platform defaults, not custom code&lt;br&gt;
The important realisation was that none of this needed a rebuild. In MemberPress, the billing-address fields are a native setting under Settings &amp;gt; Fields, and they are only forced when the store collects tax. The password and confirm fields can be removed natively too, with MemberPress auto-generating a password and emailing a set-password link. Google signup was the only piece needing a small social-login add-on. So the heavy, scary form was mostly a stack default that could be switched off, not a hard constraint.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Specced the change so the developer could ship it cleanly&lt;br&gt;
I wrote the exact plan: add Continue with Google, remove the billing-address block, switch card capture to the Stripe Payment Element so Stripe collects only the minimum the card network needs, and keep the existing GA4 and GTM events firing so the result stayed measurable. The target was email plus card, around three visible inputs, or one click with Google.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The hurdles, and how I got past them&lt;br&gt;
“Do we even need the billing address, or is removing it custom work?”&lt;/p&gt;

&lt;p&gt;Download the Medium app&lt;br&gt;
I verified it against MemberPress’s own documentation rather than guessing: address fields are a native toggle and are only mandatory when tax is being collected. I confirmed the store did not collect tax, which meant the whole block could be hidden with a setting, no custom code. That turned a nervous “can we even do this” into a five-minute change.&lt;/p&gt;

&lt;p&gt;“We still want a password.”&lt;/p&gt;

&lt;p&gt;Fine, and native. I showed the Disable Password Fields option that emails a set-password link after checkout, and the fallback of keeping a single password field but dropping the redundant "confirm" box with a show/hide toggle. The client kept control of the decision while every option stayed low-friction.&lt;/p&gt;

&lt;p&gt;Staging was locked behind HTTP basic auth, so I could not log into it.&lt;/p&gt;

&lt;p&gt;I could not drive the staging environment myself, so I grounded every recommendation in the platform documentation, the public production pages and the GA4 data, and handed the developer a precise click-path to apply and verify. The change shipped without me ever needing their admin.&lt;/p&gt;

&lt;p&gt;The rebuild quietly changed the analytics event schema.&lt;/p&gt;

&lt;p&gt;After launch, new signup events began firing that did not exist before, which made a naive before and after count misleading. I anchored the headline on the completion rate, which is robust to volume and schema shifts, and I flagged the schema change openly rather than cherry-picking a flattering absolute number.&lt;/p&gt;

&lt;p&gt;The result&lt;br&gt;
Across the four weeks after launch, measured on the same GA4 funnel: of the people who began the trial checkout, 124 of 203 completed before the change and 89 of 130 after. As rates, completion rose from 61.1% to 68.5%, and abandonment fell from about 39% to 31%.&lt;/p&gt;

&lt;p&gt;Completion rate up roughly seven points, a relative drop of about a fifth in abandonment, from a signup-flow change alone.&lt;/p&gt;

&lt;p&gt;Mechanism in one line&lt;/p&gt;

&lt;p&gt;Fewer fields and a one-click option at the exact moment of decision meant more of the people who had already chosen to sign up actually got through the door.&lt;/p&gt;

&lt;p&gt;What I was honest about: the limits&lt;br&gt;
I did not claim “more sales”. In the measured window, absolute purchases actually fell, because fewer people reached checkout at all (total traffic was down around 15%). The honest, defensible win is the completion rate, which normalises for volume and still improved clearly. I also flagged that the rebuild changed the event schema, so this is an early, directional read; a longer, stable window with the new tracking settled would firm it up further. Reporting the rate, caveats included, is more useful to the client than a flattering number that would not survive scrutiny.&lt;/p&gt;

&lt;p&gt;What I would do next&lt;br&gt;
Two fast-follows have since shipped: reassurance microcopy at the card step (cancel anytime, money-back guarantee) and a mobile pass on the trimmed form. The next move is upstream, and waits only on a clean month of the new tracking: the product pages still gate the mockup before a visitor has felt any value, so the larger gain is in how the product earns the signup in the first place. The checkout was the fastest, lowest-risk win; the deeper one is a value-first path into the tool.&lt;/p&gt;

&lt;p&gt;The heavy form was never a hard requirement. It was a default nobody had turned off, standing between ready-to-sign-up users and the product.&lt;/p&gt;

&lt;p&gt;What this used&lt;br&gt;
WordPress MemberPress Stripe (Payment Element) PayPal GA4 Google Tag Manager Conversion funnel analysis Google social login&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://pkushal.com.np" rel="noopener noreferrer"&gt;https://pkushal.com.np&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>analytics</category>
      <category>conversionrate</category>
    </item>
    <item>
      <title>A cache HIT no faster than a MISS: fixing WordPress TTFB behind an nginx proxy cache</title>
      <dc:creator>Kushal Pathak</dc:creator>
      <pubDate>Wed, 11 Nov 2026 14:43:21 +0000</pubDate>
      <link>https://dev.to/kushal_pathak/a-cache-hit-no-faster-than-a-miss-fixing-wordpress-ttfb-behind-an-nginx-proxy-cache-157n</link>
      <guid>https://dev.to/kushal_pathak/a-cache-hit-no-faster-than-a-miss-fixing-wordpress-ttfb-behind-an-nginx-proxy-cache-157n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F655hj6c1cw6qx0weczei.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F655hj6c1cw6qx0weczei.jpg" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;br&gt;
Two layers. The origin’s headers decide what the nginx cache in front is allowed to do, which is the whole story.&lt;/p&gt;

&lt;p&gt;A client’s WordPress site had slow, highly variable Time To First Byte, and an SEO audit had flagged it as “HTML not edge cached, multi-second and inconsistent first byte.” The claim was partly true, partly a measurement artifact, and the real fix was more subtle than the audit suggested. I had no DNS or CDN access, so the textbook answer was off the table. What I did have was the origin, a careful set of measurements, and one observation that reframed the entire problem.&lt;/p&gt;

&lt;p&gt;The stack I was working in&lt;br&gt;
Naming it matters, because the fix lives in how these pieces talk to each other. WordPress with Elementor Pro, cached by WP Rocket, with Gravity Forms, ACF Pro, Wordfence and Profile Builder in the render path. The web server was Apache driven by .htaccess, and in front of it sat an nginx reverse-proxy cache (an InMotion-style cPanel setup where Server: nginx fronts an Apache origin). The runtime was PHP 8.1 with Zend OPcache. My instruments were curl for header and timing analysis and Query Monitor for server-side profiling. The key realisation, early, was that this is a two-layer architecture: the cache headers the Apache origin sends decide what the nginx layer is allowed to do.&lt;/p&gt;

&lt;p&gt;Measure before you prescribe&lt;br&gt;
The audit quoted a dramatic spread, roughly 350 ms up to 5,000 ms, plus headers showing Cache-Control: max-age=0 and an Expires pinned to now. Before accepting or rejecting that, I reproduced it with repeated curl requests, capturing the full timing breakdown (DNS, connect, TLS, TTFB, total) and the headers on every load. TTFB actually sat consistently in the 2.1 to 4.3 s range, and the proxy status alternated between MISS and HIT. Then the decisive observation:&lt;/p&gt;

&lt;p&gt;A cache HIT was no faster than a cache MISS. Both sat around 2.5 seconds.&lt;/p&gt;

&lt;p&gt;That single fact pointed straight at the cause. A working HIT should serve in tens of milliseconds of server time. A HIT that costs the same as a MISS means the cache is storing the page but is forced to revalidate against the slow origin on every request, which is exactly what Cache-Control: max-age=0 plus an expired Expires instructs a shared cache to do. The cache was running and doing nothing useful.&lt;/p&gt;

&lt;p&gt;Separating network distance from real server time&lt;br&gt;
The raw numbers were inflated by my own distance from the server, so I reused a single connection across requests to pay the TLS handshake and setup only once and isolate the server’s true think time.&lt;/p&gt;

&lt;p&gt;On a warm connection the real server time separates cleanly: a served hit is a fraction of a second; the cold render is the platform floor.&lt;/p&gt;

&lt;p&gt;On a warm connection a cache HIT came in around 0.34 to 0.70 s while a real cache MISS (an actual PHP render) took 2.1 to 3.4 s. This is why “the site is slow” and “the server is slow” are not the same claim: on a cold connection from a distant location you pay DNS, TCP, TLS and several round trips before the first byte, and that alone adds well over a second. Measuring carefully stopped me from chasing network distance as if it were a server defect.&lt;/p&gt;

&lt;p&gt;Reading the actual configuration&lt;br&gt;
The site served Server: nginx yet used .htaccess, which only Apache reads. That confirmed the two layers. Reading the live .htaccess, the origin caching rules were generated by WP Rocket and included an HTML5-Boilerplate block with this line:&lt;/p&gt;

&lt;p&gt;ExpiresByType text/html "access plus 0 seconds"&lt;br&gt;
That, combined with WordPress sending its own no-cache headers for dynamic pages, is what forced max-age=0 and an immediate Expires on every HTML response, including the static cache files WP Rocket produced. The nginx layer, obeying those headers, revalidated the origin on every hit.&lt;/p&gt;

&lt;p&gt;The core fix: make anonymous HTML cacheable at the proxy&lt;br&gt;
The goal was to get nginx to serve cached HTML without revalidating the slow origin, while never caching logged-in, admin, cart or private pages. My first attempt targeted files by extension:&lt;/p&gt;

&lt;p&gt; Header set Cache-Control "public, max-age=600, s-maxage=3600" &lt;br&gt;
It did nothing for the pages that mattered, and the reason is instructive: WP Rocket on this setup serves pages through PHP ( index.php), not as static .html files, so a match on the .html extension never applied to the homepage or the service pages. I knew the block itself was active because the security headers I set unconditionally did apply. The HTML rule simply never matched the real responses. Since I could not match by extension (PHP) or by content type (mod_headers cannot condition on Content-Type), I tagged the right requests with an environment flag via mod_rewrite, then applied the cache header on that flag:&lt;/p&gt;

&lt;p&gt; RewriteEngine On RewriteCond %{REQUEST_METHOD} =GET RewriteCond %{QUERY_STRING} ="" RewriteCond %{REQUEST_URI} !^/wp-admin [NC] RewriteCond %{REQUEST_URI} !^/wp-login.php [NC] RewriteCond %{REQUEST_URI} !^/wp-json [NC] RewriteCond %{HTTP_COOKIE} !(wordpress_logged_in|wp-postpass|woocommerce_items_in_cart) [NC] RewriteRule ^ - [E=PROXY_CACHE:1]   Header set Cache-Control "public, max-age=600, s-maxage=3600" "expr=reqenv('PROXY_CACHE') == '1' || reqenv('REDIRECT_PROXY_CACHE') == '1'" Header unset Expires "expr=reqenv('PROXY_CACHE') == '1' || reqenv('REDIRECT_PROXY_CACHE') == '1'" &lt;br&gt;
The mechanism is worth spelling out, because two details are exactly where this pattern silently fails. The rewrite flags only anonymous, non-admin, no-query-string GET requests that carry no login or cart cookie. mod_headers then overrides the origin’s max-age=0 for just those requests, and because mod_headers runs after mod_expires in Apache's order, it reliably wins without editing WP Rocket's own block. The expr checks both the flag and its REDIRECT_ prefixed form, because WordPress performs an internal rewrite to index.php and internal redirects rename environment variables with that prefix. Miss that, and the header never applies. One more decision: I placed this after the # END WP Rocket marker, not inside it, because WP Rocket regenerates its own block on every cache clear and would erase anything within it.&lt;/p&gt;

&lt;p&gt;Become a Medium member&lt;br&gt;
The result: the proxy now serves cached hits from cache, and warm HIT TTFB dropped to about 0.34 s. Anonymous pages carry public, max-age=600, s-maxage=3600; logged-in and admin requests correctly stay private. The honest limit built into it: it deliberately excludes query-string URLs, so the first request to a cold page and any tracking-tagged visit still reach the origin.&lt;/p&gt;

&lt;p&gt;Three fixes I made in the same pass&lt;br&gt;
With the cache fixed, I hardened the rest at the same layer. I added a full set of security headers (frame options, nosniff, referrer policy, a locked-down permissions policy, a frame-ancestors 'self' CSP and HSTS), and flagged one caution rather than treating it as fire-and-forget: HSTS with includeSubDomains; preload must not be submitted to the preload list until every subdomain is confirmed on HTTPS, or a non-HTTPS subdomain becomes unreachable. While auditing the file tree I also found a phpinfo.php that had been publicly readable for months, exposing absolute paths, modules and exact versions, ideal reconnaissance for an attacker. I confirmed its contents, took what I needed (OPcache was already correctly enabled), and had it removed immediately.&lt;/p&gt;

&lt;p&gt;Diagnosing the render floor, and being honest about it&lt;/p&gt;

&lt;p&gt;The database was never the problem. The cost is PHP, dominated by the page builder and plugin bootstrap on every uncached request.&lt;/p&gt;

&lt;p&gt;The remaining question was the cache-miss render itself. I profiled a page with Query Monitor, and the split ruled out the obvious guess: total generation about 3.10 s, of which the database was only 0.25 s (about 8 percent) and PHP execution was about 2.85 s (about 92 percent), dominated by Elementor. So I acted on the evidence rather than the assumption. OPcache was already on and well sized, so I left it. A persistent object cache (Redis) was not offered on this plan, and with database time at only 0.25 s it would have helped little anyway, so I deactivated the object-cache plugin that could not connect rather than leave it erroring. I tuned Elementor (performance experiments, external CSS, element caching, regenerated CSS and data) and confirmed WP Rocket’s CSS and JS optimisations were on.&lt;/p&gt;

&lt;p&gt;The honest outcome: the cache-miss render stayed around 3 s, and element caching produced no measurable gain, because that time is mostly framework and plugin bootstrap on every uncached request, and element caching cannot persist between requests without a persistent object cache this host does not provide. That is the practical floor for this plugin stack on this hosting tier. The correct engineering answer is not to keep fighting the render, it is to make sure real traffic rarely hits it, which the caching layer now achieves, and to hand two items to the host: enable HTTP/2 (the site was negotiating HTTP/1.1), and confirm whether Redis or Memcached can be enabled so object and element caching can actually persist.&lt;/p&gt;

&lt;p&gt;What changed&lt;br&gt;
Who benefits: anonymous visitors and search-engine crawlers, the large majority of traffic, now get cached, fast responses. Only the first visitor after a cache window expires, and traffic carrying tracking parameters, still reaches the slower origin render.&lt;/p&gt;

&lt;p&gt;A few hurdles worth knowing&lt;br&gt;
No DNS or CDN access. The textbook fix for slow, distant TTFB is a CDN, and every CDN needs a DNS change I could not make. I stopped trying to route around it and solved it at the origin instead.&lt;br&gt;
The server banner lied. It said nginx, so my first instinct was an nginx config. The .htaccess proved Apache was the real origin behind an nginx cache, which changed the whole approach from "edit nginx" to "control the headers the origin sends."&lt;br&gt;
The first cache fix did nothing, and diagnosing why (security headers applied, the cache header did not, so the match was wrong) is what led to the rewrite-flag approach.&lt;br&gt;
The cache plugin overwrites its own config, so the override had to live after WP Rocket’s markers and win on Apache’s header ordering to survive regeneration.&lt;br&gt;
Element caching should have worked and did not. Rather than call it done, I traced the real limit: without a persistent object cache it cannot survive between requests, and the dominant cost is framework bootstrap. Naming the floor beats pretending the number moved.&lt;br&gt;
What I’d tell another engineer&lt;br&gt;
Measure before you prescribe. The audit’s dramatic numbers were partly real and partly distance, and the real defect was hidden in a single header line and in the difference between a cache that stores and a cache that serves. The most valuable move in the whole job was noticing that a HIT was no faster than a MISS, because that one comparison pointed straight at revalidation. After that, the work was about understanding which layer owned which behaviour, and being honest about the floor the platform imposed rather than chasing a number the stack could not reach.&lt;/p&gt;

&lt;p&gt;Stacks involved&lt;br&gt;
WordPress WP Rocket nginx reverse-proxy cache Apache / .htaccess mod_headers / mod_rewrite / mod_expires OPcache Query Monitor curl cPanel&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://pkushal.com.np" rel="noopener noreferrer"&gt;https://pkushal.com.np&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>wordpress</category>
      <category>nginx</category>
      <category>performance</category>
    </item>
    <item>
      <title>Recipe schema, and why "schema doesn't help rankings" misses the point</title>
      <dc:creator>Kushal Pathak</dc:creator>
      <pubDate>Wed, 04 Nov 2026 15:59:02 +0000</pubDate>
      <link>https://dev.to/kushal_pathak/recipe-schema-and-why-schema-doesnt-help-rankings-misses-the-point-13m</link>
      <guid>https://dev.to/kushal_pathak/recipe-schema-and-why-schema-doesnt-help-rankings-misses-the-point-13m</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb2rmc17dtrpwie8owhca.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb2rmc17dtrpwie8owhca.jpg" alt=" " width="799" height="391"&gt;&lt;/a&gt;&lt;br&gt;
The whole argument in one picture: same page, same rank, a very different amount of the screen.&lt;/p&gt;

&lt;p&gt;Schema markup gets dismissed as a checkbox that does not move rankings. On a narrow reading, that is often true. Adding structured data rarely lifts a page’s position on its own, and Google has said as much. But that framing measures the wrong thing. In the right niche, done properly, schema changes what your result looks like and which result types you are even allowed to appear in, and on the right site that is worth far more than a position or two.&lt;/p&gt;

&lt;p&gt;The objection, and why it is only half right&lt;br&gt;
The common experience is real: a team adds structured data, watches rankings not move, and concludes it was busywork. Structured data is not a ranking factor the way a strong backlink or better content is. So the markup gets added once and forgotten, or skipped entirely because “it doesn’t do anything for SEO.” The half that objection misses is that ranking was never what schema was for.&lt;/p&gt;

&lt;p&gt;What schema actually buys: eligibility&lt;br&gt;
What valid structured data buys is eligibility for a different kind of result. A page with correct Recipe markup can be shown as a Recipe rich result, with a thumbnail, a star rating, cook time and calories, and it can enter the Recipe gallery, the visual carousel that sits at the very top of many food queries. The URL is the same and the ranking is the same. What changes is that the result now carries an image and a rating, owns three to four times the pixels of a plain blue link, and sits in the module a searcher’s eye lands on first. That is not a ranking lever. It is a presentation and eligibility lever, and on click-through-sensitive queries it compounds.&lt;/p&gt;

&lt;p&gt;The evidence: two food brands&lt;br&gt;
Both are e-commerce stores with a body of cooking and recipe content, and both mark that content up with Recipe schema. In Google Search Console, the Search Appearance filter isolates the clicks that came specifically from the Recipe rich results and Recipe gallery appearances, traffic that exists only because those pages qualify for those result types. Names are withheld; the reports themselves are below, unedited.&lt;/p&gt;

&lt;p&gt;Brand A, a premium-beef e-commerce store&lt;/p&gt;

&lt;p&gt;Google Search Console · Search Appearance filter · custom range, ~10 months since the markup went live&lt;/p&gt;

&lt;p&gt;Press enter or click to view image in full size&lt;/p&gt;

&lt;p&gt;Recipe gallery: 4.48K clicks, 271K impressions, 1.7% CTR, average position 7.2. The line is flat at zero until the markup goes live, then climbs and holds.&lt;/p&gt;

&lt;p&gt;Press enter or click to view image in full size&lt;/p&gt;

&lt;p&gt;Recipe rich results, same property and window: 2.88K clicks, 150K impressions, 1.9% CTR. Between the two appearances, roughly 7,400 clicks traceable to the recipe markup.&lt;/p&gt;

&lt;p&gt;Brand B, a seafood e-commerce brand&lt;/p&gt;

&lt;p&gt;Google Search Console · Search Appearance filter · 3-month window from a standing start&lt;/p&gt;

&lt;p&gt;Press enter or click to view image in full size&lt;/p&gt;

&lt;p&gt;Recipe rich results: 2.26K clicks, 283K impressions, average position 8.9, from a standing start in mid-July.&lt;/p&gt;

&lt;p&gt;Press enter or click to view image in full size&lt;/p&gt;

&lt;p&gt;Recipe gallery, same window: 231 clicks, 20.1K impressions, position 6.7. A different site and product, the same pattern, clicks that did not exist before the markup did.&lt;/p&gt;

&lt;p&gt;Join The Writer's Circle event&lt;br&gt;
These clicks are incremental. They exist because of the markup, not despite it, and nothing on the ranking side had to change for them to arrive.&lt;/p&gt;

&lt;p&gt;Why it matters even when it “doesn’t help SEO”&lt;br&gt;
Grant the objection entirely, that the markup did not move a single ranking, and it still earns its place:&lt;/p&gt;

&lt;p&gt;It is incremental visibility. The rich result is additional eligibility on queries the page may already rank for, so more of the result belongs to you instead of a competitor.&lt;br&gt;
It is higher-CTR real estate. An image, a star rating and a cook time pull the eye and the click in a way a text snippet cannot.&lt;br&gt;
On e-commerce, it feeds the store. Recipe and how-to content is top of funnel; the recipe result brings the cook who later buys the cut, the tuna, the pan. Markup on editorial content quietly becomes a storefront acquisition channel.&lt;br&gt;
It is a one-time cost that keeps earning. Valid markup is built once and paid for once; the appearance keeps returning clicks with no ongoing spend.&lt;br&gt;
It is defensive. On shared queries, the competitor with markup takes the rich result and the visual slot. Skipping schema cedes that real estate by default.&lt;br&gt;
The honest part: schema is not magic&lt;br&gt;
The objection is not wrong, it is incomplete, and it is worth being precise about the limits so this does not read as schema evangelism. Structured data will not rank a thin or irrelevant page; it is not a substitute for content, links or relevance. In a niche with no matching rich-result type, detailed markup may render nothing visible in the SERP, and the “we added it and saw nothing” reaction there is fair. And it only works when it is valid and complete: the right required and recommended properties, name, image, rating, prep and cook time, ingredients, steps, nutrition, kept valid as the template changes, or Google simply declines to draw the enhancement. So the rule is not “schema always wins.” It is that in the niches which have a rich-result type, food, product, review, FAQ, how-to, events, video, jobs, detailed schema is a high-leverage, low-cost eligibility layer that deserves real time rather than a shrug.&lt;/p&gt;

&lt;p&gt;What “complete” markup actually looks like&lt;br&gt;
The gap between markup that validates and markup that earns the enhancement is the recommended fields most implementations skip. A minimal Recipe with just a name and ingredients will pass a validator and show almost nothing. The version below is the kind that qualifies for the rich result and the gallery, because it hands Google the exact things it draws: an image for the thumbnail, aggregateRating for the stars, prepTime / cookTime for the timing, real recipeInstructions as steps, and nutrition for the calorie line. It is a generic example, not any client's, but the shape is exactly what shipped:&lt;/p&gt;

&lt;p&gt;{ "&lt;a class="mentioned-user" href="https://dev.to/context"&gt;@context&lt;/a&gt;": "&lt;a href="https://schema.org" rel="noopener noreferrer"&gt;https://schema.org&lt;/a&gt;", "@type": "Recipe", "name": "Classic Banana Bread", "author": { "@type": "Organization", "name": "Example Kitchen" }, "datePublished": "2026-01-12", "image": "&lt;a href="https://example.com/images/banana-bread.jpg" rel="noopener noreferrer"&gt;https://example.com/images/banana-bread.jpg&lt;/a&gt;", "description": "A simple, moist one-bowl banana bread made with ripe bananas.", "prepTime": "PT10M", "cookTime": "PT55M", "totalTime": "PT65M", "recipeYield": "10 slices", "recipeCategory": "Dessert", "recipeCuisine": "American", "recipeIngredient": [ "3 ripe bananas, mashed", "2 cups all-purpose flour", "1/2 cup butter, melted", "3/4 cup sugar", "1 egg", "1 tsp baking soda" ], "recipeInstructions": [ { "@type": "HowToStep", "text": "Heat the oven to 175C and grease a loaf tin." }, { "@type": "HowToStep", "text": "Mix the mashed bananas with the melted butter, then stir in the sugar and egg." }, { "@type": "HowToStep", "text": "Fold in the flour and baking soda until just combined." }, { "@type": "HowToStep", "text": "Pour into the tin and bake for about 55 minutes, until a skewer comes out clean." } ], "nutrition": { "@type": "NutritionInformation", "calories": "220 calories" }, "aggregateRating": { "@type": "AggregateRating", "ratingValue": 4.7, "reviewCount": 128 } } &lt;/p&gt;

&lt;p&gt;Strip out the rating, the image or the times and the result quietly degrades back toward a plain link. The detail is not decoration, it is the eligibility.&lt;/p&gt;

&lt;p&gt;How to get it right&lt;br&gt;
Check whether your niche has a rich-result type worth targeting before investing, recipe, product, review, FAQ, how-to, event, video, job posting.&lt;br&gt;
Implement the full schema, required and recommended properties, not the bare minimum that merely validates.&lt;br&gt;
Validate and monitor. Test with the Rich Results Test, keep it valid as templates change, and watch the Enhancement reports and the Search Appearance breakdown in GSC.&lt;br&gt;
Treat rich-result eligibility as its own channel, with its own clicks, impressions and CTR, measured separately from rankings.&lt;br&gt;
Give it the time. The visible result can be nothing, or it can turn out to be the largest organic surface on the site.&lt;br&gt;
Schema rarely moves the ranking. Sometimes it moves everything else, the image, the rating, the real estate, the click, and on the right site that is worth far more than a position or two. That is the case for giving your structured data a bit more of your time than it usually gets.&lt;/p&gt;

&lt;p&gt;What this used&lt;br&gt;
Schema.org Recipe JSON-LD Recipe rich results Recipe gallery Google Search Console (Search Appearance) Rich Results Test GSC Enhancement reports&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://pkushal.com.np" rel="noopener noreferrer"&gt;https://pkushal.com.np&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
      <category>schema</category>
      <category>structureddata</category>
    </item>
    <item>
      <title>Fixing broken lead attribution on a WordPress and HubSpot site</title>
      <dc:creator>Kushal Pathak</dc:creator>
      <pubDate>Wed, 28 Oct 2026 17:13:27 +0000</pubDate>
      <link>https://dev.to/kushal_pathak/fixing-broken-lead-attribution-on-a-wordpress-and-hubspot-site-3161</link>
      <guid>https://dev.to/kushal_pathak/fixing-broken-lead-attribution-on-a-wordpress-and-hubspot-site-3161</guid>
      <description>&lt;p&gt;Every enquiry was arriving in the CRM as Direct traffic, so a business spending real money on paid search had no idea which leads came from ads. One symptom sat on top of five separate faults. Here is how I traced each one from the outside in and rebuilt the attribution path, then proved it end to end before closing the job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe9shtlhswegyrvam7jp8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe9shtlhswegyrvam7jp8.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The whole problem in one picture: with no tracking cookie, the server-side form reached the CRM with an empty token and every lead defaulted to Direct.&lt;/p&gt;

&lt;p&gt;A morning "please fix this asap" came in from a sales team: every enquiry from the website was being recorded in the CRM as Direct traffic, all the campaign data was getting lost, and that made it impossible to judge the ad spend. The headline symptom was simple. The cause was not. It was a custom-coded, server-side form pipeline where five things were quietly broken at once, and two more only surfaced once I started testing. This is how I grounded the diagnosis in evidence instead of guessing, fixed the chain in order, and followed one real submission all the way into the backend to prove it.&lt;/p&gt;

&lt;p&gt;The goal&lt;/p&gt;

&lt;p&gt;The objective was narrow and measurable: every new lead should carry its true traffic source and campaign data into the CRM, and enquiry notifications should reach the correct inbox rather than a leftover development address. The business was paying for paid search but could not attribute a single enquiry to it, so close to 100% of leads were tagged Direct, which left the marketing team unable to make a budget decision with any confidence. Fixing the attribution was the whole job.&lt;/p&gt;

&lt;p&gt;Diagnosis before a single change&lt;/p&gt;

&lt;p&gt;I started by inspecting the live site rather than taking the brief at face value. Reading the rendered DOM and the network layer showed the real tracking stack, Google Tag Manager, GA4, Google Ads and Microsoft Ads, was present and firing, but there was no HubSpot script anywhere among the scripts the page loaded. That single fact explained the headline symptom. HubSpot derives a contact's original source from its own first-party cookie (hubspotutk), set by its tracking script and read back on form submission. With no script, that cookie never exists, so every contact reaches the CRM with nothing to tie it to a session and defaults to Direct.&lt;/p&gt;

&lt;p&gt;The forms were not a standard plugin. They were custom multi-step quote forms that submitted through the WordPress REST API and fanned the lead out to several destinations server-to-server, so the fix was always going to live in PHP and in the tracking layer, not in a form-builder UI. I pulled the theme's form handlers and read them directly instead of inferring from the front end. That turned guesses into facts, and corrected my own first pass:&lt;/p&gt;

&lt;p&gt;What the handlers actually did&lt;/p&gt;

&lt;p&gt;The forms did integrate with HubSpot: each handler already built a HubSpot Forms API request and even tried to read hubspotutk from the cookie. The pieces were half-built. They had simply never been able to work, because the cookie was missing and the campaign fields were not in the payload. The internal notification, meanwhile, was wired to a personal developer inbox left in from the build, not the client's enquiries address.&lt;/p&gt;

&lt;p&gt;The five faults under one symptom&lt;/p&gt;

&lt;p&gt;No CRM tracking code on the site. The HubSpot script was not loading on any page, so the first-party cookie attribution depends on was never created.&lt;br&gt;
Custom server-side forms. The forms posted to the CRM server-to-server through the REST API, so none of the usual client-side form tracking applied.&lt;br&gt;
Fragile UTM capture. The forms read UTM parameters from the live page URL at the moment of submit, with no persistence. The moment a visitor clicked through to a second page, the campaign data was gone.&lt;br&gt;
Campaign data never reached the CRM. Even where UTMs were captured, the Forms API payload did not include them. They were only sent to unrelated downstream systems.&lt;br&gt;
Notifications going to the wrong place. The internal alert was routed to a personal inbox, so the enquiries team was not reliably seeing leads at all.&lt;/p&gt;

&lt;p&gt;How I fixed them&lt;/p&gt;

&lt;p&gt;I ordered the work so the bleeding stopped first: tracking code and routing, then persistence, then the payload. Each change went onto the live server through the host file manager and GTM, not the downloaded copy, with a backup of each file first.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Installed the CRM tracking code site-wide&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Adding the HubSpot loader through the theme means the tracking cookie is created on first visit, which is exactly what the existing form code was already looking for. This one change is the single biggest fix.&lt;/p&gt;

&lt;p&gt;add_action('wp_head', function () { ?&amp;gt;&lt;/p&gt;

&lt;p&gt;(function(){&lt;br&gt;
  var KEYS=['utm_source','utm_medium','utm_campaign','utm_term','utm_content','gclid'];&lt;br&gt;
  var q=new URLSearchParams(location.search), found={}, has=false;&lt;br&gt;
  KEYS.forEach(function(k){ if(q.get(k)){ found[k]=q.get(k); has=true; } });&lt;br&gt;
  if(has) document.cookie='attrib='+encodeURIComponent(JSON.stringify(found))&lt;br&gt;
    +';path=/;max-age='+(60*60*24*90)+';SameSite=Lax';&lt;br&gt;
  window.getAttrib=function(){&lt;br&gt;
    if(/utm_|gclid/.test(location.search)) return location.search;&lt;br&gt;
    var m=document.cookie.match(/(?:^|; )attrib=([^;]+)/);&lt;br&gt;
    try{ return m ? '?'+new URLSearchParams(JSON.parse(decodeURIComponent(m[1]))).toString() : ''; }&lt;br&gt;
    catch(e){ return ''; }&lt;br&gt;
  };&lt;br&gt;
})();&lt;/p&gt;

&lt;p&gt;&amp;lt;?php }, 5);&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Passed the campaign data into the CRM&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I added the UTM and click-ID fields to the HubSpot Forms API payload in each handler, backed by matching contact properties in the CRM, so campaign data lands on the contact record as a durable backstop alongside the cookie-based source.&lt;/p&gt;

&lt;p&gt;array('name' =&amp;gt; 'utm_source',   'value' =&amp;gt; isset($utm['utm_source'])   ? $utm['utm_source']   : ''),&lt;br&gt;
array('name' =&amp;gt; 'utm_medium',   'value' =&amp;gt; isset($utm['utm_medium'])   ? $utm['utm_medium']   : ''),&lt;br&gt;
array('name' =&amp;gt; 'utm_campaign', 'value' =&amp;gt; isset($utm['utm_campaign']) ? $utm['utm_campaign'] : ''),&lt;br&gt;
array('name' =&amp;gt; 'utm_term',     'value' =&amp;gt; isset($utm['utm_term'])     ? $utm['utm_term']     : ''),&lt;br&gt;
array('name' =&amp;gt; 'utm_content',  'value' =&amp;gt; isset($utm['utm_content'])  ? $utm['utm_content']  : ''),&lt;br&gt;
array('name' =&amp;gt; 'gclid',        'value' =&amp;gt; isset($utm['gclid'])        ? $utm['gclid']        : ''),&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fixed notification routing and cleaned the email&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I repointed the internal enquiry notification to the correct inbox and replaced a raw debug dump with a clean, readable lead summary, so the people acting on enquiries get a usable email rather than a page of diagnostics.&lt;/p&gt;

&lt;p&gt;$lead_body  = "New enquiry from the website\n\n";&lt;br&gt;
$lead_body .= "Name:       $name\n";&lt;br&gt;
$lead_body .= "Email:      $email\n";&lt;br&gt;
$lead_body .= "Phone:      $phone\n";&lt;br&gt;
$lead_body .= "Collection: {$o['place_name']}\n";&lt;br&gt;
$lead_body .= "Delivery:   {$d['place_name']}\n";&lt;br&gt;
$lead_body .= "Date:       $the_date\n";&lt;br&gt;
$lead_body .= "Load type:  $ltt\n";&lt;br&gt;
$lead_body .= "Notes:      $notes\n";&lt;br&gt;
wp_mail('', 'New Website Enquiry: ' . $name, $lead_body, $headers);&lt;/p&gt;

&lt;p&gt;Beating the false negative&lt;/p&gt;

&lt;p&gt;My first verification pass ran in a browser with heavy tracker blocking, a local security suite plus extensions. The analytics requests were being blocked locally, so the cookie did not set and the Google tags were returning 503, and a perfectly valid lead would have looked like a failure. Rather than trust that reading, I re-ran the submission in a clean browser with no blockers, which is how a real ad visitor behaves. There the cookie set correctly and the HubSpot analytics object initialised, which is the reading that actually matters. The lesson I keep from this is blunt: never validate tracking in your own hardened browser, because it lies to you in the safe direction.&lt;/p&gt;

&lt;p&gt;Surfacing the hidden failures&lt;/p&gt;

&lt;p&gt;With notifications now readable, the API responses that had been buried in debug output became visible, and they showed two downstream quote APIs returning errors on every submission (one 404, one 500). Those failures were pre-existing and unrelated to the attribution fix, but they were quietly dropping data. I also found the forms were posting to a development endpoint in production, and that a DNS check proved the supposed production host did not resolve at all, so changing the URL would have broken a working integration rather than fixing it. I flagged each with its exact status code and the business context needed to decide whether to repair or remove it, rather than leaving them to fail silently.&lt;/p&gt;

&lt;p&gt;How I verified it&lt;/p&gt;

&lt;p&gt;Verification checklist: form submission 200 OK, tracking cookie set, UTMs and click ID captured, CRM Forms API 200 accepted, internal notification sent to the enquiries inbox, customer confirmation sent, and two pre-existing third-party quote APIs failing and flagged.&lt;br&gt;
One controlled test both proved the fix and found the next problem.&lt;/p&gt;

&lt;p&gt;I ran a controlled test enquiry through a clean browser with a fully tagged URL, used a number from the range reserved for fiction so it would pass validation but reach no real person, and then followed the submission into the backend through the FluentSMTP mail log. The trace confirmed each link in the chain: the submission returned 200, the tracking cookie set, the UTMs and click ID were captured and carried through, the CRM accepted the lead with a 200, the internal notification reached the correct inbox, and the customer confirmation sent. The same trace is what exposed the two failing vendor APIs, so one test did double duty.&lt;/p&gt;

&lt;p&gt;What it changed&lt;/p&gt;

&lt;p&gt;Paid-search leads now arrive in the CRM carrying their real source and campaign instead of defaulting to Direct, which is exactly the capability the marketing team needed to judge their ad spend. Enquiry notifications reach the right inbox in a clean, usable format. After the changes went live, the client team independently confirmed that lead source was reporting correctly on their side, which closed out the original complaint. The two unrelated downstream integrations were handed back as a scoped, clearly explained follow-up rather than an open mystery.&lt;/p&gt;

&lt;p&gt;What this did not solve, and what I would carry forward&lt;/p&gt;

&lt;p&gt;An honest limit: only the homepage form was live-tested end to end. The other handlers share the same structure and the same edits, but I did not fire a real submission through each, so that remains a verification gap I named rather than papered over. The two failing vendor APIs were genuinely out of scope for an attribution fix and still need the client's side to decide repair or removal. A note I kept for myself: a development endpoint and a debug inbox left live in production are the kind of thing that survive for months precisely because nobody reads the debug output they hide in.&lt;/p&gt;

&lt;p&gt;Attribution lives in the cookie and the server token, not the UTM string. A visible UTM in the URL means nothing if the CRM's own cookie never gets set and passed back on submit.&lt;br&gt;
Half-built integrations fail silently. The form code already reached for the tracking token; it just never received one. Reading the actual handlers beat guessing from the outside.&lt;br&gt;
Test tracking in a clean browser. A privacy-hardened browser will under-report and send you chasing a problem that is not there.&lt;br&gt;
Make downstream failures loud. Burying third-party API responses in a debug blob is how a broken integration survives for months.&lt;/p&gt;

&lt;p&gt;Stacks involved&lt;br&gt;
WordPress&lt;br&gt;
WordPress REST API&lt;br&gt;
PHP&lt;br&gt;
HubSpot Forms API&lt;br&gt;
Google Tag Manager&lt;br&gt;
GA4&lt;br&gt;
Google Ads&lt;br&gt;
Microsoft Ads&lt;br&gt;
FluentSMTP&lt;br&gt;
first-party cookie attribution&lt;/p&gt;

</description>
      <category>seo</category>
      <category>webdev</category>
      <category>analytics</category>
      <category>wordpress</category>
    </item>
  </channel>
</rss>
