You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在WP All Import中从XML的CDATA中提取场地信息

Extract Venue Info from CDATA Block in WP All Import

No worries, I’ve dealt with exactly this kind of messy CDATA content in WP All Import before—here’s a straightforward way to yank out that venue info using regex pre-replacement:

Step 1: Access the Pre-Replacement Tool for Your Field

When mapping the <name> field in WP All Import, click the "Add Pre-Processing" button (it looks like a gear icon next to the field input). Select "Search & Replace" from the dropdown.

Step 2: Use This Regex to Target the Venue

In the "Search for" field, paste this regex pattern:

@\s*(.*?)\s*–

Let me break that down so you know what it’s doing:

  • @ : Matches the exact "@" character that precedes the venue
  • \s* : Matches any number of spaces (including zero) before/after the venue—handles inconsistent spacing in the feed
  • (.*?) : The non-greedy capture group that grabs everything between the @ and the "–" (this is your venue name)
  • \s*– : Matches the "–" character and any leading spaces before it

Step 3: Replace with the Captured Venue

In the "Replace with" field, just put:

$1

This tells WP All Import to replace the entire matched string with only the content captured in the (.*?) group—aka your clean venue name.

Step 4: Test It Out

Click the "Preview" button to make sure it’s working. For your example string:

<name> <![CDATA[ 31 May 2022 - 19:00 @ Strand Arts Centre - (opening time 18:00) Test Show please ignore this ]]> </name>

This should extract exactly Strand Arts Centre.

Edge Case Tip

If some entries don’t follow the @ [venue] – pattern, you can leave the "Replace entire field if found?" option unchecked. That way, if the regex doesn’t match anything, it’ll keep the original content instead of blanking it out.

内容的提问来源于stack exchange,提问作者ladygeekgeek

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 20:07:31