It turned out the issue was PHPWord was saving the documents in Word2007 format in compatibility mode. I had to modify the macro to save the documents in docx format and remove compatibility mode, and then I was able to modify the title attribute.
Code:
wdDoc.SaveAs2 FileName:=path & fname, FileFormat:=wdFormatDocumentDefault, CompatibilityMode:=wdWord2013
then
Code:
For Each sh In wdDoc.ActiveWindow.Document.InlineShapes
sh.Title = url
Next sh
That fixed it.