• Resolved grimmothy

    (@grimmothy)


    Hi @priyanshumittal ,
    Great plugin. I have added the code above it works to remove all (-).

    Is there a way to also remove all numbers in addition to dashes? (0-9)?

    I found this line of code

    $image_file_name = str_replace('-',' ',$get_file_name['filename']);

    Is this what I need to adjust? if so, how do I change this this in order to replace all numbers with blank. Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi grimmothy,

    Yes you did it right for removing the dashes from the file name,now for removing numbers [0-9] add the following code after the lines of code, you added

    $image_file_name = preg_replace(‘/\d/’, ”, $image_file_name );

    Regards
    Prakash

    Thread Starter grimmothy

    (@grimmothy)

    hi @prakashgahlot,
    But looks like ai reveived a fatal error response on the addition of code

    Fatal error: Undefined constant 'd' in /home/mirabalp/public_html/wp-content/plugins/seo-optimized-images/seo-optimized-images.php on line 90

    Anything I should do different?
    Thanks.

    Thread Starter grimmothy

    (@grimmothy)

    $image_file_name = preg_replace('/[0-9]+/', '', $image_file_name );

    the above code fixed this.
    Now i am trying to remove the space after the numbers

    Hi grimmothy,

    Please send me your website url link and screenshot of where you find issues. than i will check what the issue occurred.

    Thanks,
    Prakash

    Plugin Author webriti

    (@priyanshumittal)

    Are you still using this plugin. Is your Query resolved, not heard a call from a month.

    Closing this ticket for while, kindly reopen it if you still need help.

    Regards
    Priyanshu

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove – and 0-9 from alt images on output’ is closed to new replies.