
內容簡介
Search Regex 提供了強大的搜尋和替換函數,可用於 WordPress 文章、頁面、自定義文章類型等數據源的搜尋與替換,這些功能超越了標準搜尋功能,讓你可以搜尋和替換站點上存儲的幾乎所有數據。除了單純的搜尋,你還可以使用 PHP 正則表達式的全部功能。
你可以使用它來實現以下功能:
– 幫助從一個域名將網站搬移到另一個域名
– 更新鏈接和圖像的 URL
– 在整個站點上進行更改
可以創建搜尋篩選器以匹配任何 WordPress 表格的任何列。例如:
– 查找特定分類的所有文章
– 查找未帶有文章的所有文章元數據
– 查找在日期範圍內的所有文章
Search Regex 能夠處理小型和大型站點。
哪些數據可以搜索?
你可以搜索:
– 文章
– 頁面
– 任何自定義文章類型
– 評論(包括垃圾郵件)
– 用戶
– 元數據
– WordPress 選項
– 受支持的插件(如 Redirection)
提供完整的正則表達式支持,你可以捕獲數據並在替換中使用它。
操作
可以對匹配結果執行多種操作:
– 修改並替換結果
– 刪除結果
– 導出到 CSV 和 SQL
– 執行自定義 PHP 操作
修改和替換數據
單個項目可以通過單擊要更改的項目並使用彈出修改器進行更改。
可以對所有匹配結果執行批量修改。
所進行的修改類型取決於正在更改的數據:
– 可以在現有數字上新增或減去數字
– 可以在日期上添加幾小時、天、周和月
– 可以添加、刪除、替換標籤和分類
支持自定義短碼,可包含動態數據:
– 在內容中新增當前日期和時間,格式可自訂
– 插入其他列的數據。例如,將類別插入標題中
– 轉換現有數據。例如,更改大小寫,將下劃線改為破折號。
範例用途
以下是一些潛在使用方式的想法:
– 刪除所有匹配短語的評論
– 在所有匹配的文章中添加類別
– 刪除離群元數據
支援
請將錯誤、補丁和功能請求提交至:
https://github.com/johngodley/search-regex
請將翻譯提交至:
https://translate.wordpress.org/projects/wp-plugins/search-regex
文檔
可以在Search Regex 網站上找到完整的文檔。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Search Regex adds a powerful set of search and replace functions to WordPress posts, pages, custom post types, and other data sources. These go beyond the standard searching capabilities, and allow you to search and replace almost any data stored on your site. In addition to simple searches you have the full power of PHP’s regular expressions at your disposal.
You can use this to do things like:
– Help migrate a site from one domain to another
– Update URLs in links and images
– Perform site-wide changes
Search filters can be created to match any column of any WordPress table. For example:
– Find all posts in a category
– Find all post meta data without a post
– Find all posts in a date range
Search Regex handles small and large sites.
Search Regex has been tested with PHP from 7.4 to 8.4.
What can I search?
You can search:
– Posts
– Pages
– Any custom post type
– Comments (including spam)
– Users
– Meta data
– WordPress options
Full regular expression support is provided, and you can capture data and use it in the replacement.
Actions
A variety of actions can be performed on matching results:
– Modify and replace the result
– Delete the result
– Export to CSV and SQL
– Perform custom PHP action
Modify and Replace Data
Results can be individually modified by clicking on the item to change, and using the popup modifier.
Bulk modifications can be performed against all matching results.
The types of modification depend on the data being changed:
– Numbers can be added or subtracted to existing numbers
– Hours, days, weeks, and months, can be added to dates
– Tags and categories can be added, removed, and substitued
Custom shortcodes are supported that allow dynamic data to be included:
– Add the current date and time, in any format, to content
– Insert data from other columns. For example, insert the category into the title
– Transform existing data. For example, convert case, change underscores to dashes.
Example uses
Some ideas for potential uses:
– Delete all comments that match a phrase
– Add a category to all matching posts
– Remove orphaned meta data
Support
Please submit bugs, patches, and feature requests to:
https://github.com/johngodley/search-regex
Please submit translations to:
https://translate.wordpress.org/projects/wp-plugins/search-regex
Translations
Translations are provided by WordPress itself. You can update the translations by going to the Dashboard > Updates section of WP admin.
Documentation
Full documentation can be found on the Search Regex site.
