{"id":1495,"date":"2006-07-11T23:22:04","date_gmt":"2006-07-11T17:52:04","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/"},"modified":"2026-10-21T15:21:18","modified_gmt":"2026-10-21T09:51:18","slug":"long-words-and-urls-can-break-your-blog-template","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/","title":{"rendered":"How to Stop Long Words and URLs Breaking Your Blog Layout (2026)"},"content":{"rendered":"<p>Are <strong>long words breaking your blog layout<\/strong>? Maybe your sidebar suddenly dropped below the content, a comment stretched off the edge of the screen, or your mobile page started scrolling sideways, all without you changing the theme. The cause is often a single unbreakable string of text. Here is why it happens and the simple CSS fix that prevents it for good.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-67816\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/long-words-break-blog-layout-2026.webp\" alt=\"Long words breaking your blog layout: a puzzle with a missing piece\" width=\"1200\" height=\"630\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/long-words-break-blog-layout-2026.webp 1200w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/long-words-break-blog-layout-2026-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/long-words-break-blog-layout-2026-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/long-words-break-blog-layout-2026-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/long-words-break-blog-layout-2026-768x403.webp 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Browsers won&#8217;t wrap a word or URL that has no spaces, so a long string can push past its container and break your layout. Add <code>overflow-wrap: anywhere;<\/code> (or <code>overflow-wrap: break-word;<\/code>) to your content, sidebar and comment areas, give flex and grid children <code>min-width: 0<\/code>, and keep tables and code blocks in containers with <code>overflow-x: auto<\/code>. Then test on a phone-sized screen.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_91 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6b12c211e171c\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6b12c211e171c\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#Why_long_words_and_URLs_break_your_blog_layout\" >Why long words and URLs break your blog layout<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#A_real_example_from_2006\" >A real example from 2006<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#Where_long_strings_sneak_in\" >Where long strings sneak in<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#How_to_fix_long_words_breaking_your_blog_layout_with_CSS\" >How to fix long words breaking your blog layout with CSS<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#1_Let_long_words_wrap\" >1. Let long words wrap<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#2_Fix_flex_and_grid_layouts\" >2. Fix flex and grid layouts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#3_Contain_tables_and_code_blocks\" >3. Contain tables and code blocks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#4_Add_hyphenation_for_long_words_optional\" >4. Add hyphenation for long words (optional)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#5_Shorten_what_you_control\" >5. Shorten what you control<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#Test_before_you_trust\" >Test before you trust<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#What_is_the_difference_between_overflow-wrap_and_word-break\" >What is the difference between overflow-wrap and word-break?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#Why_does_my_mobile_site_scroll_sideways\" >Why does my mobile site scroll sideways?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#Will_these_CSS_fixes_affect_normal_text\" >Will these CSS fixes affect normal text?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/07\/long-words-and-urls-can-break-your-blog-template\/#Can_long_URLs_in_comments_break_my_theme\" >Can long URLs in comments break my theme?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_long_words_and_URLs_break_your_blog_layout\"><\/span>Why long words and URLs break your blog layout<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Browsers normally wrap text only at spaces and hyphens. A string with no break points, such as a very long word, a URL, or words joined with slashes like word1\/word2\/word3\/word4, is treated as one unbreakable unit. If it is wider than its box, it either overflows the box or forces the box to grow, pushing neighbors out of place.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"A_real_example_from_2006\"><\/span>A real example from 2006<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In the days of fixed-width, two-column 750px blog templates, our right sidebar suddenly slipped below the main content, even though the layout hadn&#8217;t been touched for a week. It looked fine in Firefox, but Internet Explorer was far less forgiving and broke the template completely. Reducing the sidebar width didn&#8217;t help.<\/p>\n<p>After many CSS tweaks, the culprit turned out to be a post title: <em>Hexakosioihexekontahexaphobia<\/em> (the fear of the number 666), written for 6\/6\/06. The sidebar&#8217;s recent posts list tried to fit that one enormous word into a narrow column, and the whole template broke. Changing the post&#8217;s timestamp to move it out of the recent posts list restored the layout instantly. Internet Explorer has since been retired, but the underlying problem is the same in every modern browser.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Where_long_strings_sneak_in\"><\/span>Where long strings sneak in<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><strong>Recent posts and popular posts widgets<\/strong> showing long titles.<\/li>\n<li><strong>Comments<\/strong> where visitors paste long URLs or type unbroken strings.<\/li>\n<li><strong>Embedded feeds and link lists<\/strong> from other sites.<\/li>\n<li><strong>Code snippets, file paths and email addresses<\/strong> in posts.<\/li>\n<li><strong>Wide tables and images<\/strong> that don&#8217;t scale down on mobile.<\/li>\n<\/ul>\n<p>On today&#8217;s responsive themes, the symptom is usually not a dropped sidebar but a page that scrolls sideways on phones, which looks broken and hurts the reading experience.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_fix_long_words_breaking_your_blog_layout_with_CSS\"><\/span>How to fix long words breaking your blog layout with CSS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1_Let_long_words_wrap\"><\/span>1. Let long words wrap<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Add this to your theme&#8217;s custom CSS (in WordPress: Appearance &gt; Customize &gt; Additional CSS, or your block theme&#8217;s styles):<\/p>\n<pre><code>.entry-content, .widget, .comment-content {\n  overflow-wrap: anywhere;\n}<\/code><\/pre>\n<p>According to <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/overflow-wrap\" target=\"_blank\" rel=\"noopener\"><strong>MDN&#8217;s overflow-wrap reference<\/strong><\/a>, <code>anywhere<\/code> lets an otherwise unbreakable string break at any point if there is no other break opportunity, and no hyphen is inserted. The older value <code>break-word<\/code> works similarly but doesn&#8217;t affect how wide the box tries to be. The legacy name <code>word-wrap<\/code> is still supported as an alias.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Fix_flex_and_grid_layouts\"><\/span>2. Fix flex and grid layouts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Modern themes use flexbox or CSS grid for columns. Flex and grid items can refuse to shrink below their content width, so one long word can still widen a column. Add:<\/p>\n<pre><code>.site-main, .sidebar {\n  min-width: 0;\n}<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"3_Contain_tables_and_code_blocks\"><\/span>3. Contain tables and code blocks<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Some content shouldn&#8217;t wrap. Let it scroll inside its own box instead of stretching the page:<\/p>\n<pre><code>pre, .wp-block-table {\n  overflow-x: auto;\n}<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"4_Add_hyphenation_for_long_words_optional\"><\/span>4. Add hyphenation for long words (optional)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>hyphens: auto;<\/code> lets the browser hyphenate words at line breaks. Per <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/hyphens\" target=\"_blank\" rel=\"noopener\"><strong>MDN&#8217;s hyphens reference<\/strong><\/a>, it only works when the page or element has a correct <code>lang<\/code> attribute and the browser has a dictionary for that language.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Shorten_what_you_control\"><\/span>5. Shorten what you control<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>Use descriptive link text instead of pasting raw URLs.<\/li>\n<li>Add spaces around slashes in titles (&#8220;word1 \/ word2&#8221;).<\/li>\n<li>Insert a soft hyphen (<code>&amp;shy;<\/code>) inside genuinely long words in titles.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Test_before_you_trust\"><\/span>Test before you trust<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Always check your blog at phone width after changing the layout. Use your browser&#8217;s developer tools (responsive mode) and try a test comment with a long URL. Google&#8217;s mobile-first indexing means the phone version is the one that counts.<\/p>\n<p>For more layout help, read <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/07\/create-free-mobile-site\/\">how to make your site mobile-friendly for free<\/a>, see <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2007\/09\/4-column-wordpress-themes-for-high-resolution-wide-screens\/\">how many WordPress theme columns you need<\/a>, and check the <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/09\/essential-web-design-elements\/\">essential web design elements your site needs<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"What_is_the_difference_between_overflow-wrap_and_word-break\"><\/span>What is the difference between overflow-wrap and word-break?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><code>overflow-wrap<\/code> only breaks a word when it can&#8217;t fit on its own line, so normal text is unaffected. <code>word-break: break-all<\/code> breaks words more aggressively, even when not needed, which can look odd for regular text.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_does_my_mobile_site_scroll_sideways\"><\/span>Why does my mobile site scroll sideways?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Usually something is wider than the screen: a long URL or word, a wide table, a fixed-width image or embed. Find it with your browser&#8217;s developer tools and apply the fixes above.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Will_these_CSS_fixes_affect_normal_text\"><\/span>Will these CSS fixes affect normal text?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. <code>overflow-wrap<\/code> only kicks in for strings too long to fit, so ordinary paragraphs wrap exactly as before.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_long_URLs_in_comments_break_my_theme\"><\/span>Can long URLs in comments break my theme?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, especially in narrow comment areas. Apply <code>overflow-wrap: anywhere<\/code> to the comment content class to keep them inside the box.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are long words breaking your blog layout? Maybe your sidebar suddenly dropped below the content, a comment stretched off the&#8230;<\/p>\n","protected":false},"author":4,"featured_media":67816,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[17],"class_list":["post-1495","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=1495"}],"version-history":[{"count":3,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1495\/revisions"}],"predecessor-version":[{"id":67828,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/1495\/revisions\/67828"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/67816"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=1495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=1495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=1495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}