The same question has been answered here but that solution does not work for me since I am not sure what is the empty field. Is there a way to drop all empty items?
Perhaps something like
\AtEveryBibitem{%
if entry is empty {
\clearfield{}
}
}
These are my attributes for biblatex:
\usepackage[
backend=biber,
backref=false,
sorting=nyt,
style=authoryear,
citestyle=authoryear]{biblatex}
This is how the references looks:
And the .cfg which I just used as-is:
\ProvidesFile{biblatex.cfg}
\DeclareNameAlias{sortname}{last-first}
% Put titles in quotes for most types
\DeclareFieldFormat
[online,article,inbook,incollection,inproceedings,thesis,unpublished,patent]
{title}{\mkbibquote{#1\addcomma}}
\DeclareFieldFormat
[book]
{title}{\mkbibemph{#1\addcomma}}
\DeclareFieldFormat
[inbook,incollection,inproceedings]
{booktitle}{\mkbibemph{#1\addcomma}}
% Attempted Fixes for ONLINE entries
\DefineBibliographyStrings{english}{%
url = {available online at},
}
\DeclareFieldFormat{url}{\bibstring{url}\space\url{#1}}
\DeclareFieldFormat{urldate}{\printtext{accessed}\space#1}
\renewbibmacro*{url+urldate}{%
\printtext[parens]{%
\printfield{url}\addsemicolon\space
\printurldate
}}
% Year formatting
\renewbibmacro*{date+extrayear}{%
\iffieldundef{\thefield{datelabelsource}year}
{}
{\printtext{%
\printfield{\thefield{datelabelsource}year}%
\printfield{extrayear}}}}%
\renewbibmacro*{date}{%
\iffieldundef{month}
{}
{\printdate}}%
\renewbibmacro*{issue+date}{%
\ifboolexpr{
test {\iffieldundef{issue}}
and
test {\iffieldundef{month}}
}
{}
{\printtext{%
\printfield{issue}%
\setunit*{\addspace}%
\printdate}}%
\newunit}
% Fix names
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\labelnamepunct}{\addperiod\space }
\renewcommand*{\finalnamedelim}{,\addspace and\addspace }
% Fix "in"
\renewbibmacro*{in:}{%
\printtext{%
in\space}}
% Gotta get rid of the "in" before journal title
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
% Make (Volume:Issue)
\newbibmacro*{volume+number+eid}{%
\printtext[parens]{%
\printfield{volume}%
\setunit*{:}%
\printfield{number}}%
\setunit{\addcomma\space}%
\printfield{eid}}
% Fix editor
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\setunit{\addspace}%
\printtext[parens]{\usebibmacro{apaeditorstrg}{editor}}%
% \usebibmacro{byeditor+othersstrg}%
\clearname{editor}%
\newunit}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\newbibmacro*{apaeditorstrg}[1]{%
\iffieldundef{#1type}
{\ifthenelse{\value{#1}>1\OR\ifandothers{#1}}
{\bibstring{editors}}
{\bibstring{editor}}}
{\ifthenelse{\value{#1}>1\OR\ifandothers{#1}}
{\bibcpstring{type\thefield{#1type}s}}
{\bibcpstring{type\thefield{#1type}}}}}
% Fix appearance of , with name lists of two
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibstring{and}\space}
\endinput
icisfinal
\LoadClass[10pt,letterpaper]{article}

biblatexalready drops all formatting for empty fields if that formatting is added by the formatting directive in a\printfieldcall (this includes most formatting in the bibliography, but not all). In particular issuing a\clearfieldwhen the field is already empty will not bring any improvement whatsoever. There are two main reasons that I can imagine for unwanted formatting remaining even though fields are empty: (1) A style relies on the presence of a mandatory field. This is the case for some settings of the standardauthoryearstyle ... – moewe Apr 24 '19 at 19:58date/yearis missing (cf. https://github.com/plk/biblatex/issues/793). In this particular case the formatting is added by an 'external'\printtextthat can't check for emptiness of fields. Sinceyear/dateis mandatory, there is no test for emptiness of those fields. (2) The style is badly coded and does not use the usualbiblatexidioms to format fields. – moewe Apr 24 '19 at 20:01date/yearissue I used as an example for case (1). – moewe Apr 24 '19 at 20:05\documentclass,\begin{document}...\end{document}and a relevant example.bibentry that reproduces the output you show when compiled in an empty folder? The output is decidedly non-standard especially if you take into account that you load the standardauthoryearstyle. – moewe Apr 26 '19 at 13:39biblatex.cfg. – moewe Apr 26 '19 at 14:42