How to add an image in WordPress using HTML Code

Images in a page/blog is a great way to get attention from the visitors. It is very easy to add images using HTML code.  In this page, we will learn how to add an image in WordPress using HTML Code.

The HTML code to insert an image look like this:-

<img src="/path/to/image-name.jpg" alt="Alternate File Name"/>


img src = It is the HTML markup that tells the browser that the website is looking for the image file.

”/path/to/image-name.jpg” = Actual directory path of your image.

alt=”Alternate File Name” = It will provide an alternate name for your image when the user is using a screen reader with the image turned off or when it takes time to load the image.

/> = This is closing tag.

Steps Required

  1. In Dashboard, go to Media and click on Add New.
  2. Select File > Select the image from your computer > open.
    Now the image is uploaded to your media library.
Media Library
  1. Click on image and Copy the URL generated by WordPress for the image you uploaded.
  1. Then, Go to Pages > All pages and select the page in which you want to add an image.
  2. Click on Text > Img > paste the copied URL in “localhost says” popup > OK.
Localhost URL
  1. Enter the description of the image > OK.
  2. Go to visual > Update > Preview Changes.

So, the image is added to your WordPress page using HTML code.

Tutorials for all brains!