
Malware Blocks: How Code Blocks Impact Website Security
Code Blocks let you add custom HTML, Markdown, CSS, JavaScript and other code to enhance your site's functionality beyond standard features. Here's how to use them effectively:
Adding a Code Block:
- Edit a page/post and click Add Block or use an insertion point
- Select the Code block option
- Click the pencil icon to open the block editor
- Enter your code in the text field
Best Practices:
- For code snippets: Enable "View Source" for better formatting and readability
- For rendering code: Select appropriate language (HTML/Markdown) from Type menu
- For CSS: Wrap in
<style>
tags and select HTML type - For JavaScript: Wrap in
<script>
tags and select HTML type

Warning: Embedded scripts disabled
Troubleshooting Tips:
- Code may not display within Index pages - try removing from Index
- Disable Ajax loading to test if it's causing issues
- If unable to edit site, disable script preview
- For widget-specific issues, contact the service provider
Important Notes:
- Preview in Safe Mode to see embedded items when logged in
- Code blocks automatically format code snippets for better readability
- Custom code requires careful implementation to avoid site issues
- Consider consulting Squarespace Experts for complex customizations
For security reasons, some code may not appear while logged in but will be visible to visitors. Use Preview mode to verify proper functionality.
Additional Resources:
- Review best practices for custom code implementation
- Consult the Squarespace Forum for developer guidance
- Consider hiring a Squarespace Expert for complex customizations
- Reference the general guide for code-based customizations
Related Articles

Retired Fonts List: Complete Guide to Replacing Unavailable Fonts
