How to customize css not to print links as urls?

  • Author
  • #1482398


    I am using The Truly Minimal theme. When I print a post, everything inside the tag is printed. How do I stop this? I think it is related to CSS. Where is the CSS and how can I change it? I bought Custom Design already. I also like to change the title font size, margin etc.

    Note: I first posted this to the general forum:

    The blog I need help with is




    can you try this bit of code in your custom css panel:

    @media print {
    .entry-content a[href]:after, .entry a[href]:after{content:" (" attr(href) ")"; display: none !important;}}

    Go to your website and refresh your cache
    (ctrl+F5 in win, apple/cmd+R on mac)
    Let me know if this works,




    @cristovaov. Thanks, but this did not work. I still see the links when I try to print.



    Hi there,
    did you copy-paste the code above?
    I’ve checked your custom css and it seems you are missing a “;” after the following bit .entry a[href]:after{content:" (" attr(href) ")"




    Great, thanks. I don’t know how I missed that “;” but I copied and pasted the code again and now it is working.

    I also tried to add “font-size:12pt” but couldn’t make it work. How can I play with font size, line height and margins, or title fonts etc.? I found this page but it is for Is there a page like that for Thanks, again.



    Make sure to include your CSS rules for print between the print query,
    An example for the font size and line heights of paragraphs with what we have added:

    @media print {
    .entry-content a[href]:after, .entry a[href]:after {
    content:" (" attr(href) ")"; display: none !important;
    /*add your custom print rules under this comment.*/
    p {

    I haven’t seen a page like the one you are referring to for
    It’s a good reference point to observe the structure of a print style, though.

    Not wanting to disappoint but in honesty I think print styling is an advanced and specific topic: the understanding of CSS+HTML properties and their relationship is paramount and perhaps out of the scope of the “Custom Design” module offered on



    @cristovaov, nice job on the CSS solution! Glad to have you around. :)

The topic ‘How to customize css not to print links as urls?’ is closed to new replies.