3.33. Saving images in post content¶
To save the images existing in the post’s content, which is found by the CSS selectors defined in Post Content Selectors, do the following:
- Go to Site Settings Page and activate Post Tab
- Go to Images Section
- Check Save all images in the post content? setting’s checkbox
- Save the site settings (See: Saving The Settings)
After these steps are done, the plugin will save the URLs existing in
src attributes of
elements inside post content and replace the URLs with the ones that point to the images in your
server. For more information, see Save all images in the post content?.
The plugin retrieves URLs in
src attributes of
img elements. If the image URLs are in
another attribute of
img elements, then you can put the URLs into
src attribute. To achieve
this, do the following:
Find out in which attribute of
imgelements the actual URLs of the images are stored. You can do this by observing the source code of the target page.
To see the HTML code of an element, write its selector into a setting that is a type of Selector and Attribute Setting and then enter
Attributeinput. Next, click to button. The results will show the HTML code of the found elements.
For example, go to Post Title Selectors, add another input group by clicking to button, and configure the new input group as follows:
Next, click to button to see the HTML code of the found
imgelements. After you are done, remove the input group by clicking to its button.
Now, you know the name of the attribute storing the actual image URL. Let’s say it is
data-srcattribute. Now, go to Exchange element attributes setting under Manipulate HTML Section section of Post Tab and configure it as follows:
If the name of the attribute is not
data-src, then enter the name you found in the previous step. For more information, see Exchange element attributes.
Since the actual image URLs are in
srcattributes, the plugin will be able to save them.
If the images are not shown by using
img elements, you can do the following:
Configure it in a way that it replaces the name of the HTML tag to
img. For example, let’s say the name of the HTML element is
my-imgand it stores the image URL in its
srcattribute. Configure the Find and replace in HTML at first load setting as follows:
If the element has a closing tag as well, add another input group by clicking to button and configure the new input group as follows:
Now, the plugin will be able to save the images since they are shown in
If the images are stored in an HTML element other than
img and in an attribute other than
src, you can use the settings under Manipulate HTML Section to turn them into
elements and/or put the image URLs into
You might ask why this guide does not explain directly getting the images from elements
img and from attributes other than
src. This is because the browsers
display images by using
src attributes. You can save the images without
turning the elements into
img elements or without turning the attributes into
but the images will not be shown in your post pages since the browsers will not be able to
understand they are actually images.