In WordPress, you can switch to HTML view (also known as the Text Editor) to edit the HTML directly within your posts or pages. Here’s how you can do it:
1. Switching to HTML View in the Block Editor (Gutenberg)
- Log In to WordPress Dashboard:
- Go to
www.yourwebsite.com/wp-adminand log in.
- Go to
- Open the Post or Page:
- Navigate to Posts > All Posts or Pages > All Pages.
- Click on the post or page you want to edit.
- Switch to Code Editor:
- In the Block Editor, click on the three vertical dots (options menu) in the upper-right corner of the editor.
- Select “Code editor” from the dropdown menu.
- You are now in HTML view where you can edit the raw HTML code.
- Edit and Save:
- Make your changes directly in the HTML code.
- Click Update or Publish to save your changes.
2. Switching to HTML View in the Classic Editor
If you are using the Classic Editor, which is the older editing interface:
- Log In to WordPress Dashboard:
- Go to
www.yourwebsite.com/wp-adminand log in.
- Go to
- Open the Post or Page:
- Navigate to Posts > All Posts or Pages > All Pages.
- Click on the post or page you want to edit.
- Switch to Text Editor:
- In the Classic Editor, you’ll see two tabs above the editing area: Visual and Text.
- Click on the Text tab to switch to HTML view.
- You can now edit the HTML code directly.
- Edit and Save:
- Make your HTML changes in the Text tab.
- Click Update or Publish to save your changes.
3. Switching to HTML View in Widgets
If you want to edit HTML within widgets:
- Log In to WordPress Dashboard:
- Go to
www.yourwebsite.com/wp-adminand log in.
- Go to
- Open Widgets:
- Navigate to Appearance > Widgets.
- Add or Edit a Text Widget:
- If you are adding a new widget, drag a Text widget to your desired widget area.
- If you are editing an existing widget, click on the widget to open its settings.
- Switch to HTML View:
- In the Text widget, you can switch between Visual and Text (HTML) view using the same tabs as in the Classic Editor.
- Edit and Save:
- Make your HTML changes.
- Click Save to apply the changes.
Summary
- Block Editor (Gutenberg): Use the Code editor option from the three-dot menu.
- Classic Editor: Switch between Visual and Text tabs.
- Widgets: Use the Text widget to edit HTML directly.
These methods allow you to make detailed changes using HTML code.
