find and replace text within your WordPress Editor

10次阅读
没有评论

If you are trying to find and replace text within your WordPress Editor (which you currently have open), WordPress doesn’t have a built-in “Find and Replace” button directly in the visual block toolbar. However, you can easily do this using a few different methods depending on what you need:

Method 1: The Standard Browser Shortcut (Quickest)

Since you are editing a post in your browser, you can use your browser’s native search function:

  1. Press Ctrl + F (Windows) or Cmd + F (Mac).
  2. Type the word you want to find.
  3. Click the small arrow next to the search box in your browser to see if it gives you a “Replace” option (some browsers like Chrome require an extension for replacing, while others have it built-in).

Note: If you just need to edit them manually, Ctrl + F will at least highlight every instance on the screen so you can jump straight to them.


Method 2: Switch to the Code Editor

If you want to use your browser’s full power or copy the text out to a text editor:

  1. Press Ctrl + Shift + Alt + M (Windows) or Cmd + Shift + Alt + M (Mac) to switch your WordPress editor from Visual mode to Code Editor mode.
  2. Select all the text (Ctrl + A), copy it, and paste it into a text editor like Notepad, VS Code, or Sublime Text.
  3. Use the text editor’s Find & Replace tool (Ctrl + H).
  4. Paste the modified code back into the WordPress Code Editor and switch back to the Visual Editor using the same shortcut.

Method 3: Bulk Replace Across Your Whole Site

I noticed in your WordPress sidebar that you already have a plugin installed called Better Search Replace (it’s listed under your Tools / 工具 menu).

If you are trying to replace a specific word, link, or piece of text across this entire article—or across multiple articles on your website all at once:

  1. Look at your left-hand admin menu and hover over 工具 (Tools).
  2. Click on Better Search Replace.
  3. In the “Search for” box, type the text you want to change.
  4. In the “Replace with” box, type the new text.
  5. Select the database tables you want to search (usually wp_posts if you are just changing article content).
  6. Uncheck “Run as a dry run?” if you are ready to make the changes permanent, and click Run Search/Replace.

(Be sure to back up your database before running bulk database replacements!)

正文完
可以使用微信扫码关注公众号(ID:xzluomor)
post-qrcode
 0
评论(没有评论)
验证码