# Biblatex: Remove comma before urldate/after url

I'm trying to get rid of the comma that's in between the url and the url date. I'm using

\DeclareFieldFormat{urldate}{%
[letzter Zugriff: %
\thefield{urlday}.
\thefield{urlmonth}.
\thefield{urlyear}\isdot]}


to get the urldate to show up as I want it to. The output with the link in front of it looks like this: What I want is to get rid of the comma before the open square bracket. My MWE looks like this:

%!TEX program = lualatex
\documentclass[a4paper, 11pt]{article}
\usepackage[a4paper,left=3cm,right=2.7cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{polyglossia}
\usepackage{fontspec}

\usepackage{setspace} %Zeilenabstand auf 1.5
\setstretch{1.4}

\setdefaultlanguage[spelling=new]{german}
\setmainfont{Arial}
\setlength{\emergencystretch}{2pt}

\usepackage[style=authoryear-ibid,backend=biber, natbib=true, dashed=false, doi=false, isbn=false, eprint=false]{biblatex} % , block=ragged
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcolon\space} % Doppelpunkt nach Jahr in Literaturverzeichnis,

\DeclareFieldFormat{urldate}{%
[letzter Zugriff: %
\thefield{urlyear}\isdot]}

%%%Für klickbare ToC
\usepackage{hyperref}
\hypersetup{
citecolor=black,
filecolor=black,
urlcolor=black,
}

\begin{document}
....
\nocite{*}
\begingroup
\raggedright
\sloppy
\printbibliography
\endgroup

\end{document}


Bibliography:

@misc{Born.04.05.2020,
author = {Frobeen, Anne},
year = {04.05.2020},
title = {Lernen im Schlaf: - ein Inter­view mit Schlaf­for­scher Jan Born},
urldate = {2021-02-20}
}

• Please provide a [MWEB]{tex.meta.stackexchange.com/questions/4407/…}. Without this we are only guessing your set up. The way you are formatting your urldate is not the way to do this. – David Purton Feb 28 at 22:11
• @DavidPurton thank you, just added it. – Emkay Feb 28 at 22:18
• Do you always have "in: " before a URL? Or just sometimes? – David Purton Feb 28 at 22:21
• I've added it in front of every URL because I've been unable to find a soulution where I can put an "in" there and this seemed to work fine – Emkay Feb 28 at 22:23
• I really cannot emphasise how much better the answer you got is than the definition of the urldate field format shown in the question: It is usually much better to use bibstrings than to hard-code text and the definition shown in the question completely disables all of biblatex's carefully crafted date handling and replaces it with a very basic approximation of manual date printing. If you got more biblatex advice from the same source you got that code from, you may want to reconsider that as well. – moewe Mar 1 at 7:37

I suggest a number of changes:

• Use the date=short option so you use the proper format for the date field (your current format is not valid).
• Use an @online type, not @misc.
• Use the url field, not the address field which will cause you problems if the URL has special characters.
• Redefine the urlseen string rather than hard coding it in the urldate format.
• Use \mkbibbrackets in your urldate format to get square brackets.
• Redefine the url format for online entries to insert "in: ".

If you do all this, then the comma before the urldate will go away by itself. You are getting it because you are abusing the address field to hold a URL.

## MWE

%! TeX Program = lualatex
\documentclass{article}
\begin{filecontents}[overwrite]{\jobname.bib}
@online{frobeen2020,
author = {Frobeen, Anne},
date = {2020-05-04},
title = {Lernen im Schlaf: - ein Inter­view mit Schlaf­for­scher Jan Born},
url = {https://www.tk.de/techniker/magazin/life-balance/besser-schlafen/schlaf-lernen-gedaechtnis-interview-jan-born-2059292},
urldate = {2021-02-02}
}
\end{filecontents}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{csquotes}
\setdefaultlanguage[spelling=new]{german}
\setmainfont{Arial}
\usepackage[style=authoryear-ibid, date=short]{biblatex}
\urlstyle{same}
\DefineBibliographyStrings{german}{
urlseen = {letzter Zugriff}
}
\DeclareFieldFormat[online]{url}{\bibstring{in}\intitlepunct\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}