@misc{ enwiki:1227001181, author = "{Wikipedia contributors}", title = "James Bruce, 8th Earl of Elgin --- {Wikipedia}{,} The Free Encyclopedia", year = "2024", url = "https://en.wikipedia.org/w/index.php?title=James_Bruce,_8th_Earl_of_Elgin&oldid=1227001181", note = "[Online; accessed 23-June-2024]" }
url
(\usepackage{url}
somewhere in the preamble), which tends to give much more nicely formatted web addresses, the following may be preferred:
@misc{ enwiki:1227001181, author = "{Wikipedia contributors}", title = "James Bruce, 8th Earl of Elgin --- {Wikipedia}{,} The Free Encyclopedia", year = "2024", howpublished = "\url{https://en.wikipedia.org/w/index.php?title=James_Bruce,_8th_Earl_of_Elgin&oldid=1227001181}", note = "[Online; accessed 23-June-2024]" }