The menu links to a product nobody can buy
A menu link added by hand outlives the product it points to. It is the most prominent link on the site and the one nobody thinks to check.
The symptom
Somebody once put a bestseller straight into the main menu: “Baltic wool throw”, right there next to Home and Contact. Months later the product went out of stock, or went back to draft. The menu item did not notice.
Menu items in WordPress are posts of their own. They store the product they link to as a number and never check again whether that product can still be bought.
The same goes for a product marked as featured (the star in the product list). Your theme or a featured-products block can keep showing it on the home page after it sells out.
What it costs
This is the most expensive dead link a store can have, because of where it sits:
- It is on every page. The header shows on the home page, on every category, on every product and at checkout. A broken menu item is not one bad link; it is one bad link on every page of the store.
- It is the link people trust most. A visitor reads the main menu as the store’s own recommendation. Following it to “Out of stock” looks like neglect in a way that the same product found through search does not.
- It wastes your strongest internal link. A link on every page tells search engines that the page matters, and this one points at a product you can’t sell.
How to check it yourself
Menu items are posts of type nav_menu_item. The product they link to is stored in
_menu_item_object_id, and _menu_item_object says that it is a product:
wp db query "SELECT t.name AS menu, mi.ID AS menu_item, p.ID AS product, p.post_title, \
p.post_status, s.meta_value AS stock_status \
FROM wp_posts mi \
JOIN wp_postmeta o ON o.post_id = mi.ID AND o.meta_key = '_menu_item_object' \
AND o.meta_value = 'product' \
JOIN wp_postmeta m ON m.post_id = mi.ID AND m.meta_key = '_menu_item_object_id' \
JOIN wp_term_relationships tr ON tr.object_id = mi.ID \
JOIN wp_term_taxonomy tt ON tt.term_taxonomy_id = tr.term_taxonomy_id AND tt.taxonomy = 'nav_menu' \
JOIN wp_terms t ON t.term_id = tt.term_id \
JOIN wp_posts p ON p.ID = m.meta_value \
LEFT JOIN wp_postmeta s ON s.post_id = p.ID AND s.meta_key = '_stock_status' \
WHERE mi.post_type = 'nav_menu_item' AND mi.post_status = 'publish' \
AND (p.post_status <> 'publish' OR s.meta_value = 'outofstock')"
Replace wp_ with your table prefix. For featured products, filter the product list by stock
status and look at the star column.
Custom links in a menu store a typed-in address in _menu_item_url instead. The query does not
cover them, and neither does Merchlint, so check those by hand.
How to fix it
- Point the menu item at a category rather than a product wherever the idea was “our best product”. Categories outlast individual products.
- If the product is coming back, leave the link and make the product page say when. A dated promise converts better than a dead end.
- If it is gone for good, remove the menu item, or the featured mark, and redirect the old product address to its replacement or its category.
- Check every menu, not just the main one. Footer and mobile menus are separate and get edited far less often.
When it’s a false alarm
- Menus set up ahead of a launch, where the link is in place on purpose before the product is published.
- Menus that are not shown anywhere. Merchlint does not check whether a menu is assigned to a place in your theme, so a link in a menu nobody sees is reported too.
How Merchlint finds it
Merchlint looks at two places where the store itself points customers to a product: classic menu items that link straight to a product, and products marked as featured. It reports a product that is out of stock or not published (draft, pending or private). A product on backorder still takes orders, so it is not reported.
Navigation blocks, page builders and custom links in menus are not covered. Reading them would mean guessing from HTML, and a check built on guesses produces false alarms.
The finding names where the product is shown (featured, or the name of the menu) and what is wrong with it: its stock status or its publication status.
Confidence: F—fact from the database. A product is out of stock or unpublished, or it is not.
This check is part of the Pro add-on, which is still being prepared. The free plugin does not run it.
Install freeDoesn't match what you see in your store? Email us—we read every message. contact@merchlint.com