I want to execute wp-cli command but it removes <script> tag

sudo runuser -l  userName -c 'wp widget add custom_html footer-1 1 --title="" --content="<script>alert(123);</script>" --path="/var/www/userName/data/www/mysite.abc"'

CentOS 7

After executing in created widget I get only alert(123); I tried to put it in single quotes, add backslashes and even urlencode() but not successful.

migrated from wordpress.stackexchange.com Oct 7 at 12:12

This question came from our site for WordPress developers and administrators.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.