Category: WooCommerce

  • What 45 WooCommerce audits taught me in one month

    In November I looked at 45 WooCommerce stores with the same script and the same questions: 15 in the US, 10 in the UK, 10 in Germany, 10 in Portugal, all independent, all with estimated revenue somewhere between fifty and a hundred thousand a month. Then a human look at each one, because the script is only the long list.

    These are the numbers I trust, the patterns behind them, and the three places where a script will mislead you if you let it.

    The numbers

    • 8 of 45 had an llms.txt. Two of those were over 600,000 characters, which is the whole site flattened into one file. I wrote about that separately.
    • 34 of 45 had Product markup on product pages. Of those, 23 had no brand, 24 had no GTIN or MPN, and 33 had no rating in the data, including stores with a reviews plugin and hundreds of reviews on the page.
    • 17 of 45 had no meta description on the homepage, and 18 had a headline problem: either no H1, or several, or the same H1 on every page of the site.
    • 27 of 45 had a meaningful share of images without alt text on the homepage. On a few it was every image.
    • Of 19 stores where I measured time to first byte, 10 took over a second and 6 took over two. One took almost five. Speed is the one thing on this list that owners always notice and rarely know how to attribute.
    • 3 of 45 sat behind Cloudflare’s managed robots block, which blocks training crawlers and not search ones.

    The pattern across all of it: the expensive things are done and the free things are not. These stores have paid themes, paid SEO plugins, paid review plugins and paid page builders. What they lack is a brand field, a sentence of description, a word of alt text and a thirty-line text file. The gap between a store an assistant can cite and one it skips is almost entirely unpaid work that nobody was assigned.

    What was different by country

    Portugal was the clearest. Portuguese stores were better at payments than I assumed and worse at words. Multibanco and MB Way were present in every store I checked properly, with a NIF field in more than half the checkouts. But meta descriptions, alt text and structured data were thinner than anywhere else, and two of the three giant llms.txt files were Portuguese. German stores had the best product content and the most paid tooling. US stores had the most staging links, placeholder emails and demo products left in production: a live site linking thirteen times to its own dev copy, a footer with the theme’s sample phone number, a shed priced at fourteen thousand dollars and named with a single dot.

    Three places a script will lie to you

    1. robots.txt

    Cloudflare’s managed robots.txt lists about thirty training crawlers and sets search=yes. A script that counts blocked AI agents reports “blocks ChatGPT”. It does not. The search and user-fetch agents are not on the list. Classify each agent as training, search or fetch before drawing a conclusion.

    2. Product schema

    Variable products get ProductGroup, not Product, from Rank Math and Yoast, nested in a @graph. A check that accepts only the second string reports missing data on exactly the stores that did the work. Walk the graph, accept both types, then look at the fields.

    3. The API is not the page

    WooCommerce’s Store API returns an empty alt for an image whose alt is empty in the media library, but the page renders the product title as alt anyway, so a count of missing alt text from the API is wrong as the visitor sees it. And the Store API’s cart, read empty and without a country, hides every payment gateway that is restricted to one country, so a Portuguese store looks like it has no Multibanco until you add a product and set a Portuguese address. Read the real checkout.

    The common thread is obvious once written down: the shortcut describes the system, the page describes what the customer and the crawler actually get. Audit the second one.

    What the method looks like now

    1. Script first, for the long list of things worth checking.
    2. Then the page itself, for every claim that will be written down. Checkout with a product in the cart and a local address. Product page in a browser, not through an API. Robots file read group by group.
    3. Then one finding at a time, with the fix next to it. An owner can act on one. Six is a list they file.

    The 45 audits produced a much shorter list of what is actually broken on independent stores in 2026 than I expected, and most of it is a day’s work per store. That is the encouraging part.

    Let’s see if we should work together.

    Free, thirty minutes, no pitch. You leave knowing what it would take.

    Or email hello@samuelsilva.pt

  • Ecommerce sites: how to be readable and cited by AI agents

    Traditional SEO was about ranking for a query. AI agents don’t rank — they cite. Your product page either becomes a fact a model quotes when someone asks it for “the best waterproof running shoes under €80”, or it gets skipped as div-soup. Being invisible to agents in 2026 is what being invisible to Google was in 2010.

    AI crawlers don’t work like search crawlers. They read the HTML, extract structured claims, compare the facts across sites, and only then synthesise an answer that may or may not mention you. The seven items below are what decide which side of that outcome you land on. None are expensive. Most take a weekend. All of them compound.

    1. Ship real Schema.org structured data

    This is the single highest-leverage item on the list, so start here. Agents treat JSON-LD as a pre-parsed fact sheet — no scraping heuristics, no guessing where the price lives, no fighting your markup. The signal-to-noise is unbeatable and every major agent respects it.

    The minimum to ship: Product (name, image, description, sku, brand), Offer (price, priceCurrency, availability, priceValidUntil), and BreadcrumbList. If you can add AggregateRating, Review, or a per-product FAQPage, do.

    What trips people up, in the order it trips them: priceValidUntil missing (Google complains, agents deprioritise), availability written as the string “in stock” instead of the full https://schema.org/InStock URL, and image as a relative path. If you’re on WooCommerce, the stock schema output or the Yoast SEO WooCommerce addon cover this — but audit what is actually on the page, don’t trust a plugin’s claim that it’s there.

    2. Keep the HTML semantic and the DOM clean

    Agents parse the DOM top to bottom. They don’t run your JS runtime, they don’t wait for your hydration, and they don’t click “load more”. The HTML that arrives in the first byte is the HTML they read.

    One <h1> per page (the product name), a <main> landmark, specs in a <dl> or a <table> instead of <div><span><span> nested four deep, <nav> for the breadcrumb, <footer> for the footer. If the site was built in a page-builder, open view-source on a product page and ask yourself: could a reader without CSS make sense of this?

    The litmus test: strip every stylesheet from the page. If a human can still understand it, an agent can too. If it collapses into an unreadable list of acronyms, the agent gave up two seconds in.

    3. Write product copy as facts, not as marketing

    Agents cite claims. Adjectives aren’t claims. “Soft, breathable, and made with care” is unquotable — no model will drop it into an answer, because it means nothing specific. “100% organic cotton, 180 gsm, GOTS-certified, dyed in Portugal, machine wash cold” is a shopping answer waiting to happen. The first sentence sounds nicer. The second one gets cited.

    You don’t lose brand voice — you move it. Keep the warmth in the headline and the opening paragraph. The spec body, the one further down the page that agents index deepest, should lead with material, dimensions, origin, certification, care. The same copy also makes your on-site semantic search work, because semantic search and external agents are both looking for the same thing: meaning you can actually state.

    4. Set an honest AI crawler policy — robots.txt and llms.txt

    If you block GPTBot, ClaudeBot, PerplexityBot and Google-Extended in your robots.txt, you have opted out of being cited. It’s that direct. And most stores that block those crawlers didn’t choose to — it was a default from a security plugin, a Cloudflare preset, or a hardening file that someone copied from a blog post in 2023.

    Open your /robots.txt, grep for those four user-agents, and if any of them is disallowed, undo it. Then add an llms.txt at the site root: a small flat index of the canonical URLs you most want agents to read.

    Honest footnote: llms.txt is still an emerging convention, less universally respected than robots.txt or sitemap.xml. The cost of adding one is zero and more agents respect it every quarter. I wrote more about this shift in my WordPress Day for AI talk — agents aren’t the only AI story, but they’re the readers now.

    5. Build real FAQ sections with FAQPage schema

    Of every schema type, FAQPage is the one agents cite most. It maps directly to the Q→A shape of the answer they’re trying to produce. If the store has a shipping page, a returns page, a size guide — each should be marked up. If products have common support questions (fit, materials, compatibility, care) — each should be too.

    Not SEO-filler FAQ. Real questions, from real support tickets, with direct short answers. Keep the question under 100 characters. Keep the answer under 300. No hedging. No “it depends, contact support”. If it depends, write the two cases as two questions.

    6. Don’t hide the content behind modals, cookie walls, or popups

    Agents don’t dismiss your newsletter modal. They don’t click “accept” on your cookie wall. They don’t choose a region on your geo-redirect. Whatever the HTML looks like with those overlays in the way is what gets read.

    A cookie banner at the bottom of the screen is fine. A cookie wall that blocks the main content until clicked is not. Nor is a modal that opens on load over the product name. Nor is a “verify your age” interstitial for a product that isn’t age-restricted. These are patterns people add for conversion reasons that silently cost them citability.

    • Cookie wall — main content not visible until consent. Switch to a banner.
    • Auth wall on product detail pages. Expose a public preview.
    • Geo-redirect on load that rewrites the URL. Serve the main locale and offer a switcher.
    • Newsletter overlay on first paint. Delay it, or kill it.
    • Infinite-scroll catalogue without SSR — the first 20 products exist, the other 980 don’t, from the crawler’s view. Paginate.

    The simplest verification: run curl -A "GPTBot" https://your-store.com/products/some-product and look at what comes back. If the product name and the price aren’t in that HTML, they’re not in the agent’s answer either.

    7. Keep URLs stable and canonical

    Agents remember URLs. When a model cites your product page in January and you ship a redesign in March that moves every /products/* to /shop/items/*, the citation goes to a 404 and your authority starts from zero. Keep permalinks permanent. If you must change them, 301 the old ones; don’t let the old URL break.

    On every product page, set rel="canonical" to the final clean URL — no ?utm_source=…, no ?sort=price, no ?color=blue variant. Faceted navigation (size, colour, price filters) should not spawn an infinite number of indexed URLs; each facet variant either canonicalises back to the primary or carries noindex.

    The classic way this breaks: product URLs that embed an auto-generated database ID. Migrate the store, the IDs regenerate, every cite in the wild becomes a 404. If you can’t change the URL structure, at least don’t let the ID regenerate.

    Where to start this week

    If you’re reading this at 11pm and want the order that moves the needle fastest: ship Product + Offer JSON-LD on every product page if it isn’t there already — that’s the biggest single unlock and it can land in a day. Then audit robots.txt and confirm the four agent crawlers aren’t blocked — a one-minute check. Then rewrite the top five product descriptions as facts, not as adjectives — one evening. Everything else fits a two-week sprint.

    The compounding is real. Every month your store is set up right, more agents cite you, and more of the shopping questions in your category have you in the answer. The window to be the default source in your niche is still open, but it is closing as more stores wake up to this. Weekends matter.

  • Stock Sync – How to sync products in a WooCommerce Multisite

    There are a lot of reasons to use the Multisite feature on a WordPress environment – the challenge is when we need to synchronize information between them. Same database, but different tables, languages and product stocks are great examples of common data between all websites. Let’s start from the beginning.

    What is WordPress Multisite?

    Using the same hosting, network and dashboard, WordPress allow us to create several websites in the same place. The advantages:

    • Same plugins/version on all websites (less maintenance time);
    • Same code, different content;
    • Same themes across the websites;
    • Better content and network management;
    • Allow us to divide the websites using subdirectories (e.g. samuelsilva.pt/courses) or subdomains (e.g. courses.samuelsilva.pt);
    • Multisite means less code, literally.

    How do the same products sync on all websites?

    They don’t sync – there is no communication between websites. Each website works with different tables in the database – sometimes can be redundant, but remember – different content is the main advantage of a WP multisite environment.

    How to sync the products on the same multisite network?

    That’s why you’re here. There are many ways to sync the products, so I’ll suggest to you which I consider the best one (without plugins).

    Before anything, please check the most important WordPress functions we will use on this code snippet:

    • get_sites() – retrieves the list of the websites from our network, depending of the args we use. In this specific case, we will use the default args;
    • switch_to_blog() – sending the blog_id (site ID) as a parameter, all your further queries results will come from that specific blog;
    • restore_current_blog() – come back the queries to the main website.

    Using these functions, we will be able to create a bridge between all the websites in the multisite network. We have a lot of possibilities, but let’s focus on a specific need – synchronize stock units between websites.

    Important question: Which field will be our key (foreign key for SQL people)?

    I don’t recommend we use the most obvious – product_id. Remember, there isn’t any relationship between the websites, so we can’t trust an autoincremented field. Let’s use the product SKU in our example. Let’s go forward to our snippet:

    Stock Products between websites – code snippet

    Follow we can find my suggestion on a code snippet. If you have any questions or suggestions, please write a comment on this post.

    /* 
    * Sync products stocks by the lowest. Run this function for each product
    * @param	string	$sku	Product SKU
    */
    public function sync_stock_by_sku ( $sku ){
    
    	// Firstly, check if we're on a WP multisite environment
    	if( ! function_exists( 'get_sites' ) || $sites = get_sites() ){
    		return;
    	}
    	
    	$stores = array();
    
    	// Prepare and array with the sites Ids
    	foreach ( $this->sites as $site ) {
    
    		// Organize the multidimensional array, indexing by country code
    		$country_c 			  = str_replace( '/', '', $site->path );	
    		$stores[ $country_c ] = $site->blog_id;
    
    	}
    
    	// in this case, we will sync all the products to the lowest stock store for this specific product
    	$lowest_stock = false;
    
    	$product_id = wc_get_product_id_by_sku( $sku );
    	$product    = wc_get_product( $product_id );
    
    	// Websites loop
    	foreach( $stores as $c_code => $store_id ){
    
    		// prepare the queries to run for each website
    		switch_to_blog( $store_id );
    
    		
    
    		
    		// Continue the loop if the line item is empty, for example
    		if( ! $product ){
    			continue;
    		}
    		
    		// If this is the first product, override the lowest stock entry
    		// and continue the loop
    		if ( ! $lowest_stock && is_bool( $lowest_stock ) ) {
    			$lowest_stock = $product->get_stock_quantity();
    			continue;
    		}
    	
    		// Check if the stock from this store is lower than the current one
    		$stock = $product->get_stock_quantity();
    
    		if ( $lowest_stock > $stock ){
    			$lowest_stock = $stock;
    		}
    
    
    	}
    
    	// Now we have the lowest stock value. Let's reloop and sync stock quantity to the lowest value
    
    	foreach( $stores as $c_code => $store_id ){
    
    		// prepare the queries to run for each website
    		switch_to_blog( $store_id );
    
    		$product_id = wc_get_product_id_by_sku( $sku );
    		$product    = wc_get_product( $product_id );
    
    
    		// Update the stock quantity
    		wc_update_product_stock( $product, $lowest_stock );
    	}
    
    	// Restore queries to the current site
    	restore_current_blog();
    
    	// Return the new stock
    	return $lowest_stock;
    
    }

  • WooCommerce – Save the Products’ Stock Status for each Order

    Stock Management is a default feature on all Online Store CMS, it’s useful when you manage your stock using WooCommerce, preventing out-of-stock Purchases and of course, preventing your clients’ complaints.

    Sometimes, beyond this obvious feature, we need to know some more about the stock status. For example: occasionally, for business rules’ reasons, it could be useful if we could know the stock status of the product at the date of a specific order.

    (more…)
  • Cancel WooCommerce not-paid Orders automatically

    One way to keep your online store clean and organized is by using the order status. Complete, Cancelled, Awaiting Payment are statuses which helps you to pay attention to the most important orders.

    But when you have a lot of “Awaiting payment” orders and you don’t know until when you need to consider that order? Well, I’m writing today because of that. A client of mine gave me this problem: I want to cancel my pending orders (awaiting payment) after 4 days.

    Before the solution we discuss about:

    • Should we need to consider all the payment methods?
    • The client should receive any type of email confirmation?
    • Which order status we need to consider?

    But after that, I started to code. Follow me, step by step:

    (more…)