• Resolved jake92

    (@jake92)


    Hi,

    I’ve changed my alt text to the filename of the image, but it still has the hyphens: – between words. I’ve looked through all your related posts but can’t figure out how to get rid of them.

    Could you explain how I can do this simply please?

    Thanks
    Jake

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jake92

    (@jake92)

    Oh and replace the hyphen with a space

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the question; I will try to give you a simple answer.

    You can replace the hyphens with spaces in your existing ALT Text values using the new “str_replace” format option code added to the most recent MLA version. This is described in a recent topic:

    Remove commas from comma-delimited lists

    You don’t say how you set the ALT Text to the file name; if you are using the Media/Assistant Bulk Edit area you can enter one of these values in the ALT Text text box:

    template:[+name_only,str_replace( '-', ' ' )+] – will replace the ALT Text value with a fresh copy of the name portion of the attached file and will replace hyphens with spaces in the new value.

    template:[+post_excerpt,str_replace( '-', ' ' )+] – will use the existing ALT Text value (post_excerpt) and replace hyphens with spaces.

    I am away from my own system until December 11 and haven’t been able to test the second alternative. Of course, it should work.

    You can get additional information in this earlier topic, which you probably already found:

    Bulk ALT Text same as image file name

    That topic links to an even earlier topic that explains how to use an IPTC/EXIF mapping rule as an alternative to the Bulk Edit area.

    I am marking this topic resolved, but please update it if you have any problems or questions regarding the above suggestions. As I wrote, I am traveling until 12/11 so my response(s) may be delayed. Thanks for your interest in the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove Hyphens from ALT’ is closed to new replies.