6.3.4.3. Quick Fixes Section
6.3.4.3.1. Remove links?
If you want to remove links from all of the short code data, check this. Checking this box is almost the same as adding the following rule for each find-replace option in this tab:
Regex: | Checked |
---|---|
Find: | <a\b[^>]*>((?:\n|.)*?)<\/a> |
Replace: | $1 |
For example, let’s say [wcc-main-content]
will be replaced with the following code:
This is a <a href="http://site.com/">link</a> that directs the user to a URL.
When this setting is checked, the short code will be replaced with the following code:
This is a link that directs the user to a URL.
All of the anchor tags, i.e. a
tags, will be removed without touching their contents. This
option will not touch custom links inside the templates. For example, let’s say you configured
Post Content Template as follows:
[wcc-main-content]
Click <a href="http://site.com/">here</a> to go to the target site.
In this case, the link you defined at the bottom of the template will not be removed. Only the
links inside the [wcc-main-content]
, and inside any other short code defined by the plugin, will be
removed.
6.3.4.3.2. Convert iframe elements to short code
WordPress does not allow iframe
elements for security reasons. If you want to show
iframe
s in the post template, you can check this. When you check this, the iframe
elements in the short code data will be converted to [wpcc-iframe]
short code that shows
iframe
s in the front end.
Important
Use this with caution since unknown iframe
s can cause security vulnerabilities. The short
code will output the HTML element only for the domains defined in
Allowed domains for iframe short code setting.
For more information, please refer to Short Codes Section.
6.3.4.3.3. Convert script elements to short code
WordPress does not allow script
elements for security reasons. If you want to show
script
s in the post template, you can check this. When you check this, script
elements
in the short code data will be converted to [wpcc-script]
short code that shows script
s
in the front end.
Important
Use this with caution since unknown script
s can cause security vulnerabilities. The short
code will output the HTML element only for the domains defined in
Allowed domains for script short code setting.
For more information, please refer to Short Codes Section.
6.3.4.3.4. Embed social media posts and other media
Check this if you want to display social media posts and other media such as audio and video on the front end. When this is checked, HTML code that is considered dangerous by WordPress will be tried to be safely converted to short codes, which makes social media posts, iframe elements from trusted domains, and HTML5 video and audio players display correctly on the front end.
The media that are added as a non-iframe element (such as the media from Imgur,
Instagram, TikTok, Tumblr, and
Twitter), the media that are added via iframe
elements and that are
trusted by WordPress, and all the source
elements are automatically embedded when you enable this setting. The
plugin will convert all the iframe
elements to [wpcc-iframe]
short code. If the source of the iframe
element
is not already trusted by WordPress, you can allow the source by using Allowed domains for iframe short code
setting. The pre-configured trusted domains include 70+ domains such as the domains of Instagram,
Facebook, Amazon, YouTube,
Twitter, Scribd, Vimeo,
Pinterest, Spotify, Meetup, and so on.
6.3.4.3.5. Remove empty HTML elements and comments
Check this if HTML elements that do not have any content and comments in the HTML code should all
be removed from all parts of the post. This does not remove the elements that should not have
any content by default, such as img
elements.
For example, if this is checked, the following code
<!-- This is a comment -->
<div><p></p></div><p>This is an example.<br><img src="http://dummy.url"><a href="#"></a>
will be turned into the following:
<p>This is an example.<br><img src="http://dummy.url"></p>
6.3.4.3.6. Remove scripts
Check this if you want to remove scripts from all parts of the post. This removes script
elements as well as HTML attributes that can store JavaScript code, such as onclick
.
For example, if this is checked, the following code
<script type="text/javascript">var x = 3;</script>
<p onclick="showPopup()">This is an <a href="#" onmouseover="redirect()">example</a>.</p>
will be turned into the following:
<p>This is an <a href="#">example</a>.</p>