claude-code - 💡(How to fix) Fix [Opus 4.7] "Claude failed to flag the well-known WooCommerce shop page hijack despite multiple iterations of the same problem; cost ~24 hours of debugging" [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54840Fetched 2026-04-30 06:34:27
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Code Example

This is a behavioural issue with Claude Code rather than a file-specific bug. For context, the artifacts created during the eventual fix were:

wp-content/mu-plugins/berksfhs-shop-page-lock.php (5 iterations to v1.1.3) - the hardware lock
wp-content/uploads/berksfhs/shop-page-lock.log - forensic stack-trace evidence of WC settings save flow
Project CLAUDE.md updated with the WC hijack pattern, hardware lock pattern, and decoupled architecture sections
recap.md updated with full session timeline and root-cause analysis

---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

Help me build a curated Elementor landing page to replace the default WooCommerce shop archive on dev.berksfhs.org. Architecture decisions, plugin stack recommendations, and debugging help across multiple sessions over 28-29 April 2026.

What Claude Actually Did

Helped competently with surface-level tasks (page layout, widget choices, CSS) but failed three times in a row to recognise that recurring "page is broken" symptoms shared a single structural cause: WooCommerce's shop page assignment hijacks the URL render of whatever page is assigned to it. Each recurrence was treated as a fresh bug to debug, with different cosmetic fixes (slug renames, redirect cleanups, plugin deactivations, permalink regeneration) - none of which addressed the actual cause.

Also recommended FiboSearch Pro + Search and Filter Pro as best-in-class for this use case without surfacing the implementation friction inherent to that stack: S&F Pro v3 versus WP.org legacy v1.2.18 codebase divergence, vendor-portal site-linking handshake required for activation, WC shop page assignment interaction. Each became a debugging surprise during installation rather than a known cost noted up-front.

The "hardware lock" pattern (filter option_woocommerce_shop_page_id to force-read a fixed value, filter pre_update_option_woocommerce_shop_page_id to block writes, must-use plugin so it can't be deactivated through admin UI) only emerged after the third failed repair cycle. This is a defensive idiom that should have been suggested proactively the first time a critical option was being silently reassigned.

Expected Behavior

  1. When a user first describes "a curated Elementor landing page that's also the WC shop page", Claude should immediately flag that this is mutually exclusive at the URL render layer - WC's archive template hijacks the assigned shop page's URL regardless of slug. Decouple, or use Elementor Pro Theme Builder for a Product Archive template. This is well-known WC architecture, not obscure trivia.
  2. When the same symptom recurs across sessions, Claude should pattern-match: "We've fixed this exact symptom before. Recurrence suggests the cause is structural, not transient." Instead of diagnosing it as new each time. Especially when I kept saying 'But we've been here before - we already fixed this, supposedly!'
  3. When recommending paid plugin stacks, Claude should surface known implementation friction alongside feature comparisons. Best-in-class on functionality is not the same as best-in-class on time-to-deploy.
  4. When a critical WordPress option keeps getting silently reassigned, Claude should suggest the defensive lock pattern (option_* + pre_update_option_* filters in a must-use plugin) on the first or second occurrence, not the third or fourth.

Files Affected

This is a behavioural issue with Claude Code rather than a file-specific bug. For context, the artifacts created during the eventual fix were:

wp-content/mu-plugins/berksfhs-shop-page-lock.php (5 iterations to v1.1.3) - the hardware lock
wp-content/uploads/berksfhs/shop-page-lock.log - forensic stack-trace evidence of WC settings save flow
Project CLAUDE.md updated with the WC hijack pattern, hardware lock pattern, and decoupled architecture sections
recap.md updated with full session timeline and root-cause analysis

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Use Claude Code on a WordPress site with WooCommerce installed.
  2. Tell Claude: "I want to build a curated Elementor landing page that will be my WooCommerce shop."
  3. Follow Claude's suggestions to build the page and assign it as the shop page in WooCommerce → Settings → Products → General → Shop page.
  4. Visit the page's URL on the front-end. Observe that WC has hijacked the render - the Elementor design is partial or absent, and a default product loop appears.
  5. Ask Claude to diagnose. Note that the suggestions focus on slug changes, redirect cleanups, or plugin conflicts rather than flagging the architectural mismatch.
  6. Apply Claude's fix. Watch it last roughly 60 minutes.
  7. Ask Claude to diagnose again. Note that Claude treats the second occurrence as a new bug.
  8. Repeat steps 5-7 a third time before either the user or Claude eventually pattern-matches.

The expected behaviour is for step 2 to trigger an immediate architectural warning about the hijack, before any building happens.

Claude Model

Opus

Relevant Conversation

Impact

Critical - Data loss or corrupted project

Claude Code Version

2.1.77

Platform

Anthropic API

Additional Context

  1. Estimated equivalent of £1500 in professional time lost
  2. The first session ended with a context-overflow crash from a 2.1M-character HTML paste; the recap for that session had to be reconstructed from the JSONL transcript
  3. The fix that actually worked: decoupled architecture (curated landing page is NOT WC's shop page; a separate empty placeholder is) plus a must-use plugin lock that filters reads, blocks writes, and surfaces both reactive (after blocked save) and proactive (on WC settings page visit) admin banners with full stack-trace logging
  4. Project CLAUDE.md has been updated with all five lessons learned, so future Claude sessions on this codebase will start from a stronger position. The remaining feedback is for Claude Code's general behavioural defaults
  5. Happy to share the full lock plugin source, log entries with stack traces, and recap files if useful for case-study purposes

extent analysis

TL;DR

The issue can be resolved by implementing a decoupled architecture, where the curated landing page is not assigned as the WooCommerce shop page, and using a must-use plugin to lock critical WordPress options.

Guidance

  • Identify the architectural mismatch between the curated Elementor landing page and the WooCommerce shop page, and flag it immediately when the user describes the requirement.
  • Pattern-match recurring symptoms to identify structural causes, rather than treating each occurrence as a new bug.
  • Surface known implementation friction when recommending paid plugin stacks, including potential conflicts with other plugins or WordPress settings.
  • Suggest the defensive lock pattern (option_* + pre_update_option_* filters in a must-use plugin) when critical WordPress options are being silently reassigned.

Example

// Example of a must-use plugin to lock critical WordPress options
add_filter('option_woocommerce_shop_page_id', 'lock_woocommerce_shop_page_id');
add_filter('pre_update_option_woocommerce_shop_page_id', 'block_update_woocommerce_shop_page_id');

function lock_woocommerce_shop_page_id($value) {
    // Return a fixed value to prevent changes
    return 123; // Replace with the desired page ID
}

function block_update_woocommerce_shop_page_id($value) {
    // Block updates to the option
    return false;
}

Notes

The provided solution is specific to the described issue and may not apply to other scenarios. The must-use plugin approach requires careful consideration to avoid unintended consequences.

Recommendation

Apply the workaround by implementing a decoupled architecture and using a must-use plugin to lock critical WordPress options, as this approach has been proven to resolve the issue in the described scenario.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING