LokusWP

Your WordPress Navigator

How to Edit Text in WordPress: Using Block Editor, Translation, and Code

In this guide, we’ll explore three methods for changing text in WordPress:

  1. Using the Block Editor (Gutenberg) for easy text editing.
  2. Using Translation Text with Loco Translate to modify plugin-generated content.
  3. Directly Editing the Source Code (Not recommended, but covered with a helpful plugin).

1. Changing Text Using the Block Editor (Gutenberg)

When to Use the Block Editor:

The Block Editor (Gutenberg) is the simplest way to change text if it was created using blocks (e.g., Paragraph, Heading, List, etc.). It gives you direct control over content and doesn’t require any coding knowledge.

Steps:

  1. Access Your Post or Page:
    • In your WordPress dashboard, go to Posts or Pages.
    • Choose the post or page you want to edit.
  2. Locate the Text Block:
    • In the Block Editor, content is split into blocks. If the text you want to change is within a text block (e.g., Paragraph or Heading), simply click on the block.
  3. Edit the Text:
    • Once you’ve selected the block, you can edit the text directly. Just type or paste in your new content.
  4. Save Your Changes:
    • After editing, click Update or Publish to save the changes.

Tip: If the text is not editable in the Block Editor, it’s probably plugin-generated content.


2. Changing Plugin-Generated Text Using Translation

When to Use Translation:

Image

If the text you want to change doesn’t appear in the Block Editor, it’s likely controlled by a plugin. In such cases, you can modify the text without coding by using translation plugins like Loco Translate.

Steps to Change Plugin Text:

  1. Install Loco Translate Plugin:
    • Go to PluginsAdd New and search for Loco Translate.
    • Install and activate the plugin.
  2. Access Loco Translate:
    • After activation, navigate to Loco Translate in your WordPress dashboard.
  3. Select the Plugin:
    • Under Loco Translate, choose the plugin whose text you want to change.
    • Select the language to edit (usually English).
  4. Find and Edit the Text:
    • In the Loco Translate editor, you’ll see a list of translatable strings.
    • Use the search bar to find the text you want to change.
    • Edit the text in the Translation field.
  5. Save Changes:
    • After making the necessary edits, click Save to apply the changes.

Why Use Translation?

Using Loco Translate is the safest and easiest method to change plugin-generated text. It allows you to change the display text without modifying plugin code. This method ensures that your changes will persist even after the plugin is updated.


When to Use Code:

Editing source code directly should be your last resort. This method is not recommended because plugin updates will likely overwrite your changes. However, in some cases, it may be the only option for changing specific text if the plugin doesn’t allow for translation.

Steps (For Advanced Users):

  1. Locate the Plugin Files:
    • You can find plugin files either through AppearanceTheme Editor or via FTP.
    • Navigate to the plugin’s folder in wp-content/plugins/plugin-name/.
  2. Search for the Text:
    • Open the relevant file (e.g., plugin-name.php) and search for the text you want to change.
  3. Edit the Text:
    • Edit the text directly within the plugin’s code.
  4. Save and Test:
    • Save the file and test the site to ensure it’s working as expected.

Important Warning:

  • Plugin Updates: When the plugin updates, it will overwrite your changes. Any text edits will be lost unless you make modifications in a child theme or custom plugin.
  • Error Risk: Direct code changes can break functionality if you’re not careful.

Alternative: Using the String Locator Plugin

If you prefer not to edit the source code manually, you can use the String Locator plugin to help find specific strings within plugin files.

  1. Install and Activate String Locator Plugin:
    • Go to PluginsAdd New, search for String Locator, and install it.
  2. Search for Text:
    • After activation, go to ToolsString Locator.
    • Use the search field to find the specific text string you want to change within the plugin files.
  3. Edit the Text:
    • You can then make the necessary changes directly or use this to locate the text in the plugin files for easier modification.

Note: This method helps you locate text more quickly, but it still involves code changes, which may be lost with updates.


Conclusion:

Here’s a recap of the best methods to change text in WordPress:

  • Use the Block Editor if the text is created with blocks, for a simple and straightforward solution.
  • Use Translation with Loco Translate for plugin-generated text. This method is the safest and allows for permanent changes.
  • Use Code Editor should be avoided as plugin updates may overwrite your changes, and it requires coding knowledge. Use String Locator to find and edit text more easily.

By following this tutorial, you’ll be able to change text across your WordPress site, whether it’s editable directly in the Block Editor, generated by plugins, or controlled via code.

3 Way to Edit Text in WordPress